spatie / laravel-permission
Permission handling for Laravel 8.0 and up
Fund package maintenance!
spatie
Installs: 55 798 035
Dependents: 902
Suggesters: 12
Security: 0
Stars: 12 206
Watchers: 191
Forks: 1 781
Open Issues: 8
Requires
- php: ^8.0
- illuminate/auth: ^8.12|^9.0|^10.0|^11.0
- illuminate/container: ^8.12|^9.0|^10.0|^11.0
- illuminate/contracts: ^8.12|^9.0|^10.0|^11.0
- illuminate/database: ^8.12|^9.0|^10.0|^11.0
Requires (Dev)
- larastan/larastan: ^1.0|^2.0
- laravel/passport: ^11.0|^12.0
- orchestra/testbench: ^6.23|^7.0|^8.0|^9.0
- phpunit/phpunit: ^9.4|^10.1
- dev-main / 6.x-dev
- 6.10.1
- 6.10.0
- 6.9.0
- 6.8.0
- 6.7.0
- 6.6.0
- 6.5.0
- 6.4.0
- 6.3.0
- 6.2.0
- 6.1.0
- 6.0.1
- 6.0.0
- v5.x-dev
- 5.11.1
- 5.11.0
- 5.10.2
- 5.10.1
- 5.10.0
- 5.9.1
- 5.9.0
- 5.8.0
- 5.7.0
- 5.6.0
- 5.5.16
- 5.5.15
- 5.5.14
- 5.5.13
- 5.5.12
- 5.5.11
- 5.5.10
- 5.5.9
- 5.5.8
- 5.5.7
- 5.5.6
- 5.5.5
- 5.5.4
- 5.5.3
- 5.5.2
- 5.5.1
- 5.5.0
- 5.4.2
- 5.4.1
- 5.4.0
- 5.3.2
- 5.3.1
- 5.3.0
- 5.2.0
- 5.1.1
- 5.1.0
- 5.0.0
- v4.x-dev
- 4.4.3
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.0
- 4.2.0
- 4.1.0
- 4.0.1
- 4.0.0
- v3.x-dev
- 3.18.0
- 3.17.0
- 3.16.0
- 3.15.0
- 3.14.0
- 3.13.0
- 3.12.0
- 3.11.0
- 3.10.1
- 3.10.0
- 3.9.0
- 3.8.0
- 3.7.2
- 3.7.1
- 3.7.0
- 3.6.0
- 3.5.0
- 3.4.1
- 3.4.0
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0
- v2.x-dev
- 2.38.0
- 2.37.0
- 2.36.1
- 2.36.0
- 2.35.0
- 2.34.0
- 2.33.0
- 2.32.0
- 2.31.0
- 2.30.0
- 2.29.0
- 2.28.2
- 2.28.1
- 2.28
- 2.27.0
- 2.26.2
- 2.26.1
- 2.26.0
- 2.25.0
- 2.24.0
- 2.23.0
- 2.22.1
- 2.22.0
- 2.21.0
- 2.20.0
- 2.19.2
- 2.19.1
- 2.19.0
- 2.18.0
- 2.17.1
- 2.17.0
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.2
- 2.12.1
- 2.12.0
- 2.11.0
- 2.10.0
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.2
- 2.8.1
- 2.8.0
- 2.7.9
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.4
- 2.7.3
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.0
- 2.5.4
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.0.2
- 2.0.1
- 2.0.0
- v1.x-dev
- 1.18.0
- 1.17.0
- 1.16.1
- 1.16.0
- 1.15.0
- 1.14.1
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.1
- 1.11.0
- 1.10.0
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.1
- 1.6.0
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- 0.0.1
This package is auto-updated.
Last update: 2024-11-27 21:25:32 UTC
README
Associate users with permissions and roles
Documentation, Installation, and Usage Instructions
See the documentation for detailed installation and usage instructions.
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, you can check if a user has a permission with Laravel's default can
function:
$user->can('edit articles');
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
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. We publish all received postcards on our virtual postcard wall.
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Testing
composer test
Security
If you discover any security-related issues, please email security@spatie.be instead of using the issue tracker.
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.
Credits
This package is heavily based on Jeffrey Way's awesome Laracasts lessons on permissions and roles. His original code can be found in this repo on GitHub.
Special thanks to Alex Vanderbist who greatly helped with v2
, and to Chris Brown for his longtime support helping us maintain the package.
And a special thanks to Caneco for the logo ✨
Alternatives
- Povilas Korop did an excellent job listing the alternatives in an article on Laravel News. In that same article, he compares laravel-permission to Joseph Silber's Bouncer, which in our book is also an excellent package.
- santigarcor/laratrust implements team support
- ultraware/roles (archived) takes a slightly different approach to its features.
- zizaco/entrust offers some wildcard pattern matching
License
The MIT License (MIT). Please see License File for more information.