Laravel Permission stores roles and permissions in the database and wires them to users, guards, and Laravel’s authorization gate.
Overview
Laravel Permission is a Spatie package for Laravel that manages authorization data in the database. Permissions represent specific capabilities such as editing content, while roles group permissions that you assign to users or other models.
After installation, application code can grant permissions directly, assign roles, and attach permissions to roles. Each guard can maintain its own permission and role sets when an app uses multiple authentication guards.
Because permissions register with Laravel’s gate, standard authorization checks and Blade directives work with permission names. Teams use it to replace ad hoc boolean flags with a consistent role and permission model across routes, policies, and views.
The package builds on established Laravel training patterns for roles and permissions and is maintained as a widely used add-on for permission-heavy business applications.
Key features
- Permissions stored in the database
- Roles grouping multiple permissions
- Assign roles and permissions to users
- Multiple guard support
- Integration with Laravel Gate
- Blade @can authorization directives
- givePermissionTo and assignRole APIs
- Role–permission assignment helpers
Use cases
- Admin versus editor access tiers
- Fine-grained feature toggles per user
- Multi-guard API and web authorization
- Centralizing capability checks in policies
- Managing writer-style role templates