| Install | |
|---|---|
composer require konekt/acl |
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 test if a user has a permission with Laravel's default can function:
$user->can('edit articles');
https://konekt.dev/acl/master/README
Please see Changelog for more information what has changed recently.
This package is a modified variant of Spatie Permission package which 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.
The MIT License (MIT). Please see License File for more information.