rdx / laravel-authgate-policies
Takes abilities from a list of policy classes.
Installs: 1 388
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: ^8.0
This package is auto-updated.
Last update: 2024-12-21 06:34:37 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.