You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Overridable controllers, policies and default permissions (RBAC, multi-auth) #9
Routes:Route::locations() takes guard, prefix, name, middleware (default auth:{guard}), only, except and controllers. The guard is stored in the route action, as Route::roles() does.
Controllers: one per type on LocationsController, overridable from config.
Permissions:view_/edit_/delete_{countries,states,cities,atolls,islands}, registered through javaabu/permissions.
Policies: on ResourcePolicy, overridable with config('permissions.policies') or Gate::policy(). Subclasses (app models, translatable variants) are covered.
Tests: feature tests cover authorization per ability and two guards (web → User, web_admin → Admin).
Decision: a location with children isn't deleted (409 / a flashed error), and the foreign keys restrict deletes.
Activity
Admin pages, route macros, policies and permissions for every locatio…
n4ff4h commentedon Nov 5, 2026
Done:
Route::locations()takesguard,prefix,name,middleware(defaultauth:{guard}),only,exceptandcontrollers. The guard is stored in the route action, asRoute::roles()does.LocationsController, overridable from config.view_/edit_/delete_{countries,states,cities,atolls,islands}, registered through javaabu/permissions.ResourcePolicy, overridable withconfig('permissions.policies')orGate::policy(). Subclasses (app models, translatable variants) are covered.web→ User,web_admin→ Admin).Decision: a location with children isn't deleted (409 / a flashed error), and the foreign keys restrict deletes.