PHPackages                             quillphp/casbin - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. quillphp/casbin

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

quillphp/casbin
===============

Casbin RBAC/ABAC authorization for the Quill PHP framework

00PHPCI passing

Since Apr 6Pushed 2d agoCompare

[ Source](https://github.com/quillphp/quill-casbin)[ Packagist](https://packagist.org/packages/quillphp/casbin)[ RSS](/packages/quillphp-casbin/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Quill Casbin Middleware
=======================

[](#quill-casbin-middleware)

Industrial-strength RBAC/ABAC authorization middleware for the [Quill PHP Framework](https://quillphp.com). Powered by [PHP-Casbin](https://casbin.org).

Installation
------------

[](#installation)

```
composer require quillphp/casbin
```

Usage
-----

[](#usage)

```
use Quill\Casbin\Casbin;

$app->use(Casbin::new([
    'model' => __DIR__ . '/model.conf',
    'adapter' => __DIR__ . '/policy.csv',
]));
```

Configuration
-------------

[](#configuration)

OptionDefaultDescription`enforcer``null`**Required**. An instance of `Casbin\\Enforcer`.`sub\_resolver``fn(Request $r) =&gt; $r-&gt;get('user') ?? 'anonymous'`Resolves the Subject from the request.`obj\_resolver``fn(Request $r) =&gt; $r-&gt;path()`Resolves the Object from the request.`act\_resolver``fn(Request $r) =&gt; $r-&gt;method()`Resolves the Action (HTTP method) from the request.`error\_code``403`HTTP status code for access denied.`error\_message``'Forbidden: You do not have permission to access this resource'`Error message for access denied.License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4742b2ad737c14793d6b0a418e6da90b446153a4d7ba120a1f3c07e2a2951d28?d=identicon)[quillphp](/maintainers/quillphp)

---

Top Contributors

[![fr3on](https://avatars.githubusercontent.com/u/26393383?v=4)](https://github.com/fr3on "fr3on (1 commits)")

---

Tags

abacapiauthorizationcasbinphprbac

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M98](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M105](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M34](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M117](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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