laravel-permission

Associate users with roles and permissions

Github stars Tracking Chart

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.

Overview

Name With Ownerspatie/laravel-permission
Primary LanguagePHP
Program languagePHP (Language Count: 2)
Platform
License:MIT License
Release Count189
Last Release Name6.7.0 (Posted on )
First Release Name0.0.1 (Posted on )
Created At2015-09-14 22:19:38
Pushed At2024-05-10 18:38:54
Last Commit At
Stargazers Count11.9k
Watchers Count194
Fork Count1.8k
Commits Count1.7k
Has Issues Enabled
Issues Count1388
Issue Open Count6
Pull Requests Count482
Pull Requests Open Count7
Pull Requests Close Count270
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private
To the top