Reference
composer require langsys/laravel-access-guard Caching
Section titled “Caching”The role → permission map is cached (config cache.store / expiration_time) and flushed automatically on grant/revoke and any role/permission save or delete. Flush manually with php artisan access-guard:cache-reset.
Artisan commands
Section titled “Artisan commands”php artisan access-guard:create-permission view_projects "View projects"php artisan access-guard:create-role project_admin "Project Admin" --permissions=view_projects,edit_projectsphp artisan access-guard:show # roles and the permissions they grantphp artisan access-guard:cache-resetAnywhere a permission or role name is accepted you can pass a string or a backed enum:
enum Ability: string { case ViewProjects = 'view_projects'; }
$role->grantPermissions([Ability::ViewProjects]);AccessGuard::allows(Ability::ViewProjects, $project);Events
Section titled “Events”Set events_enabled => true to fire RoleAssignedToModel, RoleRemovedFromModel, PermissionAssignedToRole, and PermissionRemovedFromRole — useful for audit logging.
Testing
Section titled “Testing”composer installcomposer test