New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

spatie/laravel-permission

Permission handling for Laravel 12 and up
138,433,234 12,990

Larablocks Analysis

Compatibility

Trusted maintainer

spatie/laravel-permission works with Laravel 12 and 13 (latest release 8.5.0, Nov 6, 2026).

Laravel 5 to 11 in earlier releases.

  • Trusted maintainer: spatie publishes 287 packages on Larablocks, with 204,166,383 downloads a month between them.

Recommendation checks

Recommended

Recommended by Larablocks: meets all 4 checks.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Nov 6, 2026)
  • 10,474,130 downloads a month (at least 10,000)
  • 12,990 GitHub stars (at least 100)

State

Actively maintained
  • Last stable release: Nov 6, 2026.
  • 23 releases in the last 12 months.
  • First released: Sep 15, 2015.
  • Monthly downloads: 10,474,130, up 138% from six months ago.
  • 6 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 25, 2026.

Install
composer require spatie/laravel-permission
Latest Version:8.5.0
PHP:^8.3
Laravel:12 · 13
Older releases:5 – 11
License:MIT
Last Updated:Nov 17, 2026
Links: GitHub  ·  Packagist
Maintainer: spatie
Logo for laravel-permission

Associate users with permissions and roles

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Documentation, Installation, and Usage Instructions

See the documentation for detailed instructions for how-to-use, as well as installation and upgrade guidance.

What It Does

This package allows you to manage user permissions and roles in a database.

Once installed you can do stuff like this:

// Adding permissions to a user
$user->givePermissionTo('edit articles');

// Adding permissions via a role
$user->assignRole('writer');

$role->givePermissionTo('edit articles');

Because all permissions will be registered on Laravel's gate, you can check if a user has a permission with Laravel's default can function:

$user->can('edit articles');

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Testing

composer test

Security

If you discover any security-related issues, please email security@spatie.be instead of using the issue tracker.

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

We publish all received postcards on our company website.

Credits

This package is heavily based on Jeffrey Way's awesome Laracasts lessons on permissions and roles. His original code can be found in this repo on GitHub.

Special thanks to Alex Vanderbist who greatly helped with v2, and to Chris Brown for his longtime support helping us maintain the package.

Special thanks to Caneco for the original logo.

Alternatives

License

The MIT License (MIT). Please see License File for more information.

Related Packages

larakeeps/guard-shield

GuardShield é um repositório laravel com a função de aplicar regras de permissio...

1,957 1
iracode-com/filament-organizational-shield

Filament organizational shield for filament shield package

29 2
bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

6,875,689 2,833
visualappeal/laravel-rbac

Role based access control for Laravel 5

17,644 0
phpzen/laravel-rbac

Role based access control for Laravel 5

3,252 37

Version History

Version Released PHP Laravel License
8.5.0 ^8.3 ^12.0|^13.0 MIT
8.4.1 ^8.3 ^12.0|^13.0 MIT
8.4.0 ^8.3 ^12.0|^13.0 MIT
8.3.2 ^8.3 ^12.0|^13.0 MIT
8.3.1 ^8.3 ^12.0|^13.0 MIT