Gate & policy integration
composer require langsys/laravel-access-guard With register_gate on (default), Gate checks against a GuardableResource route through Access Guard, so the idiomatic Laravel APIs just work:
$user->can('edit_projects', $project);$this->authorize('edit_projects', $project); // in a controller@can('edit_projects', $project) {{-- ... --}}@endcanThe hook is grant-only (the same contract as spatie/laravel-permission’s): it answers true when the subject holds the permission and abstains otherwise — it never denies. Your gates and policies therefore keep full authority, even on GuardableResource models.
The one consequence to know: permissions grant. A held permission short-circuits allow before a policy that would have denied, so don’t give a policy method the same name as a permission unless you want the permission to win. A subject whose isSuperAdmin() is true passes every Gate check (super_admin_via_gate). Set register_gate => false to leave the Gate completely untouched — the facade, middleware, and everything else work the same without it.
Permissions already work in Blade through @can. For the entity-scoped role check there’s a dedicated directive:
@hasrole('project_admin', $project) {{-- visible only to admins of this project --}}@endhasrole