rdx / laravel-authgate-policies
Takes abilities from a list of policy classes.
1.0
2023-01-21 02:08 UTC
Requires
- php: ^8.0
This package is auto-updated.
Last update: 2024-10-21 06:09:57 UTC
README
- Install with composer.
- Define which policies to load in your
AuthServiceProvider
(see below).
Abilities' names will follow method names:
function manageAllUsers()
becomes abilitymanage-all-users
function see360DegreeFeedback()
becomes abilitysee360-degrees-feedback
function see_360DegreeFeedback()
becomes abilitysee-360-degrees-feedback
Replace your AuthServiceProvider
with this:
use App\Policies;
use rdx\authgate\PoliciesServiceProvider;
class AuthServiceProvider extends PoliciesServiceProvider {
protected $policies = [
Policies\UserPolicy::class,
Policies\FilePolicy::class,
// All your policy classes
];
}
If you want to add more register()
or boot()
code, be sure to call parent::register()
or parent::boot()
!
See PoliciesServiceProvider
for more options.