Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

laravel-permission

> 后端框架
Open source

Associate users with roles and permissions

12.9K stars0 likes6 views
WebsiteGitHub

About

Associate users with roles and permissions

Documentation, Installation, and Usage Instructions

See the documentation for detailed instructions for how-to-use, as well as installation and upgrade guidance.

What It Does

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

Once installed you can do stuff like this:

php
// 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:

php
$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

bash
composer test

Security

If you discover any security-related issues, please email [email protected] 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

  • Chris Brown
  • Freek Van der Herten
  • All Contributors

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.

Special thanks to Caneco for the original 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.

Issues· 4 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPlaravelpermissionphpsecure

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 2, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架