PHPackages                             casbin/medoo-adapter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. casbin/medoo-adapter

ActiveLibrary[Database &amp; ORM](/categories/database)

casbin/medoo-adapter
====================

Medoo adapter for php-casbin.

v2.0.0(1y ago)44712Apache-2.0PHPPHP &gt;=8.0CI failing

Since Sep 9Pushed 1y ago3 watchersCompare

[ Source](https://github.com/php-casbin/medoo-adapter)[ Packagist](https://packagist.org/packages/casbin/medoo-adapter)[ RSS](/packages/casbin-medoo-adapter/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (4)Versions (10)Used By (0)

Medoo Adapter for Casbin
========================

[](#medoo-adapter-for-casbin)

[![Build Status](https://github.com/php-casbin/medoo-adapter/actions/workflows/build.yml/badge.svg)](https://github.com/php-casbin/medoo-adapter/actions/workflows/build.yml)[![Coverage Status](https://camo.githubusercontent.com/0fb58ca3e586a27e1207a9c38cf7ef24ed81d00e14f8d586fbeba873b7fd5018/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7068702d63617362696e2f6d65646f6f2d616461707465722f62616467652e737667)](https://coveralls.io/github/php-casbin/medoo-adapter)[![Latest Stable Version](https://camo.githubusercontent.com/d6c354596984c3afc39efb0b749b02aaab8823d2f81b964854d9dce03d9dc18a/68747470733a2f2f706f7365722e707567782e6f72672f63617362696e2f6d65646f6f2d616461707465722f762f737461626c65)](https://packagist.org/packages/casbin/medoo-adapter)[![Total Downloads](https://camo.githubusercontent.com/09d8f5a0875b0a8022b5d66d67908ae110d45a0cd66ce70ad8f578a829ae952e/68747470733a2f2f706f7365722e707567782e6f72672f63617362696e2f6d65646f6f2d616461707465722f646f776e6c6f616473)](https://packagist.org/packages/casbin/medoo-adapter)[![License](https://camo.githubusercontent.com/1e1f14016d94d44026c1eb532e2c72658419dbb58ccfd3e225dd2d597ea19a01/68747470733a2f2f706f7365722e707567782e6f72672f63617362696e2f6d65646f6f2d616461707465722f6c6963656e7365)](https://packagist.org/packages/casbin/medoo-adapter)

[Medoo](https://github.com/catfan/Medoo) Adapter for [PHP-Casbin](https://github.com/php-casbin/php-casbin), [Casbin](https://casbin.org/) is a powerful and efficient open-source access control library.

`Medoo` is a lightweight PHP Database Framework to Accelerate Development, supports all SQL databases, including `MySQL`, `MSSQL`, `SQLite`, `MariaDB`, `PostgreSQL`, `Sybase`, `Oracle` and more.

### Installation

[](#installation)

Via [Composer](https://getcomposer.org/).

```
composer require casbin/medoo-adapter

```

### Usage

[](#usage)

```
require_once './vendor/autoload.php';

use Casbin\Enforcer;
use CasbinAdapter\Medoo\Adapter as DatabaseAdapter;

$config = [
    'database_type' => 'mysql',
    'server' => '127.0.0.1',
    'database_name' => 'test',
    'username' => 'root',
    'password' => '',
    'port' => '3306',
];

$adapter = DatabaseAdapter::newAdapter($config);

$e = new Enforcer('path/to/model.conf', $adapter);

$sub = "alice"; // the user that wants to access a resource.
$obj = "data1"; // the resource that is going to be accessed.
$act = "read"; // the operation that the user performs on the resource.

if ($e->enforce($sub, $obj, $act) === true) {
    // permit alice to read data1
} else {
    // deny the request, show an error
}
```

### Getting Help

[](#getting-help)

- [php-casbin](https://github.com/php-casbin/php-casbin)

### License

[](#license)

This project is licensed under the [Apache 2.0 license](LICENSE).

###  Health Score

38

—

LowBetter than 84% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 52.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~234 days

Recently: every ~298 days

Total

9

Last Release

557d ago

Major Versions

v1.7.0 → v2.0.02024-10-29

PHP version history (2 changes)v1.2.0PHP &gt;=7.1.0

v2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f32cb7625515c0969fec15915be4a137f057c3484420bb7abf025c8e975dd3a5?d=identicon)[leeqvip](/maintainers/leeqvip)

---

Top Contributors

[![leeqvip](https://avatars.githubusercontent.com/u/35752209?v=4)](https://github.com/leeqvip "leeqvip (10 commits)")[![basakest](https://avatars.githubusercontent.com/u/47746206?v=4)](https://github.com/basakest "basakest (8 commits)")[![Dobmod](https://avatars.githubusercontent.com/u/33273950?v=4)](https://github.com/Dobmod "Dobmod (1 commits)")

---

Tags

abacaccess-controlaclcasbinmedoopermissionsrbacrestfulsecuritydatabaseadapteraclpermissionrbaccasbinmedoo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/casbin-medoo-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/casbin-medoo-adapter/health.svg)](https://phpackages.com/packages/casbin-medoo-adapter)
```

###  Alternatives

[casbin/dbal-adapter

Database Abstraction Layer adapter for php-casbin.

1494.7k1](/packages/casbin-dbal-adapter)[casbin/yii-permission

Use Casbin in Yii2 PHP Framework, Casbin is a powerful and efficient open-source access control library.

468.0k](/packages/casbin-yii-permission)[casbin/casbin

a powerful and efficient open-source access control library for php projects.

1.3k1.4M54](/packages/casbin-casbin)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[casbin/think-authz

An authorization library that supports access control models like ACL, RBAC, ABAC for ThinkPHP.

27918.5k6](/packages/casbin-think-authz)[casbin/webman-permission

webman casbin permission plugin

523.4k2](/packages/casbin-webman-permission)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
