Repolode
spatie

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. 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