RBAC - v1.0.0
ArtisanPack UI RBAC Documentation
Role-based access control for Laravel: roles with hierarchy, permissions, Blade directives, middleware, and Gate integration.
This package is standalone — it does not depend on artisanpack-ui/security and can be used by any Laravel application or package (e.g. cms-framework) that needs roles and permissions without pulling in the full security suite.
What's in this package
- Eloquent
RoleandPermissionmodels with parent / child role hierarchy HasRolesandHasPermissionstraits for the User model- Recursive permission resolution through the role hierarchy, with per-user caching
- Route middleware (
permission:slug,slug) for permission-gated routes @roleand@permissionBlade directives- Gate integration (
$user->can('slug'),Gate::allows('slug'),@can('slug')) backed by RBAC permissions - Artisan commands for CRUD over roles and role assignments
- Configurable model bindings so consumers can extend
Role/Permissionwith their own subclasses - Eloquent observer events on the
rbac.*channel for downstream auditing
Documentation map
- Getting Started — 5-minute install + first role / permission
- Installation — install, requirements, configuration
- Usage — roles, permissions, middleware, Blade directives, Gate integration, Artisan commands
- Advanced — extending the base models, events, caching
- FAQ
- Troubleshooting
Related packages
| Package | Scope |
|---|---|
artisanpack-ui/security |
Core: input sanitization, output escaping, KSES, CSP, security headers |
artisanpack-ui/security-auth |
2FA, password complexity, account lockout, sessions |
artisanpack-ui/security-advanced-auth |
WebAuthn, SSO, social login |
artisanpack-ui/secure-uploads |
File validation, malware scanning, secure storage |
artisanpack-ui/security-analytics |
Event logging, anomaly detection, SIEM, dashboards (subscribes to rbac.* events) |