Using SystemRoles in Your App
Check permissions in code, protect routes with middleware, connect Blade, gates and policies, and customise the admin screens.
- Checking Permissions in Code All checks go through BabeRuka\SystemRoles\Services\SystemRolesService. Its helper methods are static, so you can call them anywhere.
- Protecting Routes with Middleware SystemRoles ships one middleware, super_admin, which protects its own admin area. To protect your routes, add one of the middleware below. Middleware is the…
- Blade, Gates and Policies SystemRoles works alongside Laravel's own authorization. Connecting the two lets you use @can, $user->can(), Gate::allows() and ->can() on routes with…
- Customising the Admin Screens The admin screens are Blade views under the systemroles:: namespace. They use Bootstrap 5, DataTables, Remix Icon and Font Awesome, loaded from…