Go access control library that enforces ACL, RBAC, and ABAC authorization policies, configured through model and policy files.
spatie/laravel-permission
A Laravel package for storing users, roles and permissions in the database and checking them through Laravel's gate.
- Stars
- 12,981
- Forks
- 1,815
- Open issues
- 0
- Last commit
- 23 hours ago
What is it?
laravel-permission lets a Laravel application associate users with roles and permissions, with both stored in the database. Permissions can be granted directly to a user or through a role, so a user can be given the role "writer" and inherit the permissions attached to it.
Once permissions are registered, they are exposed through Laravel's gate, so the standard `can` method and authorization helpers work with them without extra wiring. The package is written for PHP and Laravel, and installation and upgrade steps are covered in its official documentation.
Key features
- 01Assign permissions directly to users or indirectly through roles.
- 02Check access with Laravel's built-in `can` function via the gate.
- 03Store roles and permissions in the database.
- 04Give roles their own permission sets that can be updated at runtime.
Use cases
- Restricting admin panel or content editing features to users with specific roles.
- Granting editors permission to edit articles while readers can only view them.
- Building role-based access control in a multi-user Laravel application.
Quick start
- 1
Follow the installation and usage guide in the external documentation
Topics
FAQ
- What is laravel-permission?
- A Laravel package for storing users, roles and permissions in the database and checking them through Laravel's gate. laravel-permission lets a Laravel application associate users with roles and permissions, with both stored in the database. Permissions can be granted directly to a user or through a role, so a user can be given the role "writer" and inherit the permissions attached to it.
- Is laravel-permission free to use? What license does it have?
- laravel-permission is open source under the MIT license. Check the license terms before using it in commercial products.
- Is laravel-permission still maintained?
- Actively maintained. The last commit to laravel-permission was on Nov 6, 2026.
- What can I use laravel-permission for?
- Restricting admin panel or content editing features to users with specific roles. Granting editors permission to edit articles while readers can only view them. Building role-based access control in a multi-user Laravel application.
- How do I install laravel-permission?
- Follow the installation and usage guide in the external documentation
- Where can I get laravel-permission?
- The source code and installation instructions are on GitHub: https://github.com/spatie/laravel-permission
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source authorization service inspired by Google Zanzibar for building fine-grained RBAC, ReBAC and ABAC access controls outside your app code.
Self-hosted authorization engine (PDP) that evaluates YAML policies to decide who can perform which actions on which resources.
Open-source authentication and authorization infrastructure built on OIDC and OAuth 2.1, with multi-tenancy, enterprise SSO and RBAC for SaaS and AI apps.
A general-purpose policy engine that lets you write authorization and compliance rules in Rego and evaluate them from services, Kubernetes, and other systems.
A TypeScript data layer with a Prisma-compatible ORM, built-in access control, and automatic CRUD APIs and TanStack Query hooks.