laravel-permission

Associate users with roles and permissions

Github星跟踪图

Associate users with permissions and roles

Latest Version on Packagist

StyleCI
Total Downloads

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.

Documentation, Installation, and Usage Instructions

See the DOCUMENTATION for detailed installation and usage instructions.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email freek@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, Samberstraat 69D, 2060 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.

Alternatives

License

The MIT License (MIT). Please see License File for more information.

主要指标

概览
名称与所有者spatie/laravel-permission
主编程语言PHP
编程语言PHP (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2015-09-14 22:19:38
推送于2025-04-09 22:10:36
最后一次提交
发布数200
最新版本名称6.17.0 (发布于 )
第一版名称0.0.1 (发布于 )
用户参与
星数12.4k
关注者数191
派生数1.8k
提交数1.8k
已启用问题?
问题数1433
打开的问题数7
拉请求数521
打开的拉请求数5
关闭的拉请求数282
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?