PHPackages                             catname/laravel-permission - 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. catname/laravel-permission

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

catname/laravel-permission
==========================

Permission handling for Laravel 6.0 and up

5.4.5(4y ago)08MITPHPPHP ^7.2.5|^8.0

Since Sep 15Pushed 4y agoCompare

[ Source](https://github.com/Catname/laravel-permission)[ Packagist](https://packagist.org/packages/catname/laravel-permission)[ Docs](https://github.com/spatie/laravel-permission)[ GitHub Sponsors](https://github.com/catname)[ RSS](/packages/catname-laravel-permission/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (5)Dependencies (7)Versions (158)Used By (0)

[![Social Card of Laravel Permission](/art/socialcard.png)](/art/socialcard.png)

Associate users with permissions and roles
==========================================

[](#associate-users-with-permissions-and-roles)

### Sponsor

[](#sponsor)

  [![](https://user-images.githubusercontent.com/6287961/92889815-d64c3d80-f416-11ea-894a-b4de7e8f7eef.png)](https://user-images.githubusercontent.com/6287961/92889815-d64c3d80-f416-11ea-894a-b4de7e8f7eef.png) If you want to quickly add authentication and authorization to Laravel projects, feel free to check Auth0's Laravel SDK and free plan at [https://auth0.com/developers](https://auth0.com/developers?utm_source=GHsponsor&utm_medium=GHsponsor&utm_campaign=laravel-permission&utm_content=auth). [![Latest Version on Packagist](https://camo.githubusercontent.com/8dac7f853825c1340b3a9d9a7905a75e01876fb19df42e145bf076a27d61f444/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d7065726d697373696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-permission)[![](https://github.com/spatie/laravel-permission/workflows/Run%20Tests/badge.svg?branch=master)](https://github.com/spatie/laravel-permission/workflows/Run%20Tests/badge.svg?branch=master)[![Total Downloads](https://camo.githubusercontent.com/ad5f5474cf3f24431e97d50a8db551720b656aaf774137db2ebcb4ac074fa16e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d7065726d697373696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-permission)

说明
--

[](#说明)

在 laravel-permission 的基础上，针对中文环境进行修改，增加权限绑定路由，权限绑定 HTTP请求 和中文权限名，角色名。

Documentation, Installation, and Usage Instructions
---------------------------------------------------

[](#documentation-installation-and-usage-instructions)

See the [DOCUMENTATION](https://docs.spatie.be/laravel-permission/) for detailed installation and usage instructions.

What It Does
------------

[](#what-it-does)

This package allows you to manage user permissions and roles in a database.

Once installed you can do stuff like this:

```
// Adding permissions to a user
$user->givePermissionTo('edit articles');

// Adding permissions via a role
$user->assignRole('writer');

$role->givePermissionTo('edit articles');
```

Because all permissions will be registered on [Laravel's gate](https://laravel.com/docs/authorization), you can check if a user has a permission with Laravel's default `can` function:

```
$user->can('edit articles');
```

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/5b28028ab09fa239a01792616a22d242a2b681d3718c0efff875e16102148964/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d7065726d697373696f6e2e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-permission)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Postcardware
------------

[](#postcardware)

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

We publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards).

Credits
-------

[](#credits)

- [Chris Brown](https://github.com/drbyte)
- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

This package is heavily based on [Jeffrey Way](https://twitter.com/jeffrey_way)'s awesome [Laracasts](https://laracasts.com) lessons on [permissions and roles](https://laracasts.com/series/whats-new-in-laravel-5-1/episodes/16). His original code can be found [in this repo on GitHub](https://github.com/laracasts/laravel-5-roles-and-permissions-demo).

Special thanks to [Alex Vanderbist](https://github.com/AlexVanderbist) who greatly helped with `v2`, and to [Chris Brown](https://github.com/drbyte) for his longtime support helping us maintain the package.

And a special thanks to [Caneco](https://twitter.com/caneco) for the logo ✨

Alternatives
------------

[](#alternatives)

- [Povilas Korop](https://twitter.com/@povilaskorop) did an excellent job listing the alternatives [in an article on Laravel News](https://laravel-news.com/two-best-roles-permissions-packages). In that same article, he compares laravel-permission to [Joseph Silber](https://github.com/JosephSilber)'s Bouncer, which in our book is also an excellent package.
- [ultraware/roles](https://github.com/ultraware/roles) takes a slightly different approach to its features.
- [santigarcor/laratrust](https://github.com/santigarcor/laratrust) implements team support
- [zizaco/entrust](https://github.com/zizaco/entrust) offers some wildcard pattern matching

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 55.7% 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 ~14 days

Recently: every ~3 days

Total

157

Last Release

1630d ago

Major Versions

3.18.0 → 4.0.02021-01-27

v3.x-dev → 4.0.12021-03-22

4.4.0 → 5.0.02021-08-31

4.4.1 → 5.1.12021-09-01

4.4.2 → 5.2.02021-10-28

PHP version history (6 changes)0.0.1PHP &gt;=5.5.0

1.5.0PHP &gt;=5.6.0

2.0.0PHP &gt;=7.0

3.0.0PHP ^7.2

3.10.1PHP ^7.2.5

3.18.0PHP ^7.2.5|^8.0

### Community

Maintainers

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

---

Top Contributors

[![drbyte](https://avatars.githubusercontent.com/u/404472?v=4)](https://github.com/drbyte "drbyte (578 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (274 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (40 commits)")[![Catname](https://avatars.githubusercontent.com/u/26786959?v=4)](https://github.com/Catname "Catname (16 commits)")[![erikn69](https://avatars.githubusercontent.com/u/4933954?v=4)](https://github.com/erikn69 "erikn69 (15 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (14 commits)")[![musapinar](https://avatars.githubusercontent.com/u/7329873?v=4)](https://github.com/musapinar "musapinar (12 commits)")[![tomlankhorst](https://avatars.githubusercontent.com/u/675432?v=4)](https://github.com/tomlankhorst "tomlankhorst (11 commits)")[![sergejostir](https://avatars.githubusercontent.com/u/21297285?v=4)](https://github.com/sergejostir "sergejostir (7 commits)")[![springleng](https://avatars.githubusercontent.com/u/1900972?v=4)](https://github.com/springleng "springleng (6 commits)")[![artissant](https://avatars.githubusercontent.com/u/2280426?v=4)](https://github.com/artissant "artissant (5 commits)")[![juvpengele](https://avatars.githubusercontent.com/u/30692796?v=4)](https://github.com/juvpengele "juvpengele (5 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (4 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (4 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (4 commits)")[![lowerends](https://avatars.githubusercontent.com/u/6588791?v=4)](https://github.com/lowerends "lowerends (4 commits)")[![barryatswisnl](https://avatars.githubusercontent.com/u/18284224?v=4)](https://github.com/barryatswisnl "barryatswisnl (4 commits)")[![ctf0](https://avatars.githubusercontent.com/u/7388088?v=4)](https://github.com/ctf0 "ctf0 (3 commits)")[![mattdfloyd](https://avatars.githubusercontent.com/u/185187?v=4)](https://github.com/mattdfloyd "mattdfloyd (3 commits)")[![matthewgoslett](https://avatars.githubusercontent.com/u/1571743?v=4)](https://github.com/matthewgoslett "matthewgoslett (3 commits)")

---

Tags

laravelsecurityaclpermissionrolespermissionsrbac

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/catname-laravel-permission/health.svg)

```
[![Health](https://phpackages.com/badges/catname-laravel-permission/health.svg)](https://phpackages.com/packages/catname-laravel-permission)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[wnikk/laravel-access-rules

Simple system of ACR (access control rules) for Laravel, with roles, groups, unlimited inheritance and possibility of multiplayer use.

103.6k1](/packages/wnikk-laravel-access-rules)[erag/laravel-role-permission

A simple and easy-to-install role and permission management package for Laravel, supporting versions 10.x and 11.x

404.2k](/packages/erag-laravel-role-permission)

PHPackages © 2026

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