NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #222 most downloaded on Packagist
Permission handling for Laravel 12 and up
Last release 3 months ago
03 Jul 2026
Ships fairly regularly
a new release about every 4 weeks
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
224 releases · first in 2015
Fix initializeCache() not clearing in-memory perms collection on tenant/cache switch by @drbyte in #2965
initializeCache() not clearing in-memory perms collection on tenant/cache switch by @drbyte in #2965Full Changelog: 8.2.0...8.3.0
initializeCache() not clearing in-memory perms collection on tenant/cache switch by @drbyte in https://github.com/spatie/laravel-permission/pull/2965Full Changelog: https://github.com/spatie/laravel-permission/compare/8.2.0...8.3.0
One column per quarter.
Fire PermissionDetachedEvent when syncing permissions (symmetry with syncRoles) by @chengkangzai in #2963
->using(CustomPivot::class)) on roles()/permissions() with teams enabled. (Issue #2867) by @drbyte in #2961Watch out for in your own test suite:
deleting/deleted hooks to react to role/permission removal under teams, those hooks were already unreliable in this scenario and remain out of scope — switch to listening for RoleDetachedEvent / PermissionDetachedEvent instead.revokePermissionTo() can now throw GuardDoesNotMatch in rare cases where it previously wouldn't have, as a side effect of routing through the same guard-check used by givePermissionTo(). This should not affect normal usage (permissions being revoked are already guard-matched), but if your tests exercise unusual multi-guard setups, re-run them against this release.Full Changelog: 8.1.0...8.2.0
Fixed: mismatched surrounding quote characters in pipe-delimited role strings are now preserved instead of stripped. by @albertoarena in #2960
Fixes malformed pipe strings that start with ' or " and do not end with the same quote. Normal documented usage is unchanged:
hasAnyRole('writer|admin') // same
hasAnyRole("'writer|admin'") // same
hasAnyRole('"writer|admin"') // same
hasAnyRole("'writer|admin") // changed: mismatched apostrophe is removed
hasAnyRole("'writer|admin\"") // changed: mismatched quote is removedFull Changelog: 8.0.0...8.1.0
Extend BackedEnum support on Role/Permission by @YasserB94 in #2953
Full Changelog: 7.4.2...8.0.0
Remove stale phpstan ignore HasPermission instanceof.alwaysFalse by @YasserB94 in #2952
Full Changelog: 7.4.1...7.4.2
Full Changelog: https://github.com/spatie/laravel-permission/compare/7.4.1...7.4.2
Do not throw from teams() when teams feature is disabled by @freekmurze in #2949
Full Changelog: 7.4.0...7.4.1
Full Changelog: https://github.com/spatie/laravel-permission/compare/7.4.0...7.4.1
Bump dependabot/fetch-metadata from 2 to 3 by @dependabot [bot] in #2945
Full Changelog: 7.3.0...7.4.0
Full Changelog: https://github.com/spatie/laravel-permission/compare/7.3.0...7.4.0
Downgraded PHP requirement to 8.3.
Downgraded PHP requirement to 8.3.
Full Changelog: 7.2.4...7.3.0
Downgraded PHP requirement to 8.3.
Full Changelog: https://github.com/spatie/laravel-permission/compare/7.2.4...7.3.0
Bump ramsey/composer-install from 3 to 4 by @dependabot [bot] in #2936
Full Changelog: 7.2.3...7.2.4
Full Changelog: https://github.com/spatie/laravel-permission/compare/7.2.3...7.2.4
Update config comments to point to new v7 event class names
Clear wildcard permission index when assigning or removing roles by @freekmurze in https://github.com/spatie/laravel-permission/pull/2925
Full Changelog: https://github.com/spatie/laravel-permission/compare/7.2.1...7.2.2
Upgrade to laravel/passport ^13.0
Fix: do not treat string '0' as empty role/permission input by @laraib15 in https://github.com/spatie/laravel-permission/pull/2916
Full Changelog: https://github.com/spatie/laravel-permission/compare/7.1.0...7.2.0
[v7] Bring back support for PHP 8.3 by @ssw1cblarrion in https://github.com/spatie/laravel-permission/pull/2918
Full Changelog: https://github.com/spatie/laravel-permission/compare/7.0.0...7.1.0
Removed deprecated clearClassPermissions() method
The aim for v7 is to modernize the codebase while keeping the upgrade path easy. Modern PHP/Laravel features, Pest tests, but no big architectural changes. A future v8 could then tackle larger changes and streamline the package more fundamentally.
PackageServiceProvider from spatie/laravel-package-toolsEvent suffix (PermissionAttached → PermissionAttachedEvent, etc.)Command suffix (CacheReset → CacheResetCommand, etc.)is_a($this, X::class) → $this instanceof Xget_class($obj) → $obj::classstrpos($x, $y) !== false → str_contains($x, $y)WildcardPermissionuse imports for global classesclearClassPermissions() method__construct from Wildcard contractFull Changelog: https://github.com/spatie/laravel-permission/compare/6.24.1...7.0.0
Add Laravel 13 compatibility to old branch, so that 3rd party packages can support L13 without urgent upgrading
Full Changelog: 6.24.1...6.25.0
Add team support to permission:assign-role command by @freekmurze in https://github.com/spatie/laravel-permission/pull/2910
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.24.0...6.24.1
PHP 8.5: Fix deprecated usage of null as array key by @jnoordsij in https://github.com/spatie/laravel-permission/pull/2904
null as array key by @jnoordsij in https://github.com/spatie/laravel-permission/pull/2904Full Changelog: https://github.com/spatie/laravel-permission/compare/6.23.0...6.24.0
Performance enhancement: Reduce unnecessary container resolution calls by @imhayatunnabi in https://github.com/spatie/laravel-permission/pull/2889
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.22.0...6.23.0
Dispatch RoleDetached on syncRoles when events are enabled by @josedaian in https://github.com/spatie/laravel-permission/pull/2869
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.21.0...6.22.0
Allow removing multiple roles with the removeRole method by @TobMoeller in https://github.com/spatie/laravel-permission/pull/2859
removeRole method by @TobMoeller in https://github.com/spatie/laravel-permission/pull/2859teams-permissions.md by @dualklip in https://github.com/spatie/laravel-permission/pull/2863Full Changelog: https://github.com/spatie/laravel-permission/compare/6.20.0...6.21.0
Add translations support for exception messages by @nAa6666 in https://github.com/spatie/laravel-permission/pull/2852
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.19.0...6.20.0
Revert "Remove collectPermissions that is not being assigned" by @erikn69 in https://github.com/spatie/laravel-permission/pull/2851
collectPermissions that is not being assigned" by @erikn69 in https://github.com/spatie/laravel-permission/pull/2851Full Changelog: https://github.com/spatie/laravel-permission/compare/6.18.0...6.19.0
refactor exception throwing in migration file to use throw_if() by @ccaioadriano in https://github.com/spatie/laravel-permission/pull/2819
permission. prefix on wildcard_permission key by @jerrens in https://github.com/spatie/laravel-permission/pull/2835collectPermissions that is not being assigned by @JHWelch in https://github.com/spatie/laravel-permission/pull/2840Full Changelog: https://github.com/spatie/laravel-permission/compare/6.17.0...6.18.0
Route macro functions: add backed enum support by @Yi-pixel in https://github.com/spatie/laravel-permission/pull/2823
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.16.0...6.17.0
Middleware: support enums in role/permission middleware by @marklawntalk in https://github.com/spatie/laravel-permission/pull/2813
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.15.0...6.16.0
Added 4 events for adding and removing roles or permissions by @sven-wegner in https://github.com/spatie/laravel-permission/pull/2742
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.14.0...6.15.0
LDAP model lookup from Auth Provider by @crossplatformconsulting in https://github.com/spatie/laravel-permission/pull/2750
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.13.0...6.14.0
LazyLoading: Explicitly call loadMissing('permissions') when the relation is needed, and test with Model::preventLazyLoading() by @erikn69 in https://
loadMissing('permissions') when the relation is needed, and test with Model::preventLazyLoading() by @erikn69 in https://github.com/spatie/laravel-permission/pull/2776Full Changelog: https://github.com/spatie/laravel-permission/compare/6.12.0...6.13.0
### What's Changed * Support Laravel 12 Full Changelog: https://github.com/spatie/laravel-permission/compare/6.11.0...6.12.0
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.11.0...6.12.0
Add configurable team resolver for permission team id (helpful for Jetstream, etc) by @adrenallen in https://github.com/spatie/laravel-permission/pull
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.10.1...6.11.0
Fix #2749 regression bug in 6.10.0 : "Can no longer delete permissions" by @erikn69 in https://github.com/spatie/laravel-permission/pull/2759
6.10.0 : "Can no longer delete permissions" by @erikn69 in https://github.com/spatie/laravel-permission/pull/2759Full Changelog: https://github.com/spatie/laravel-permission/compare/6.10.0...6.10.1
Fix GuardDoesNotMatch should accept collection by @erikn69 in https://github.com/spatie/laravel-permission/pull/2748
GuardDoesNotMatch should accept collection by @erikn69 in https://github.com/spatie/laravel-permission/pull/2748cache key exists and forgetCachedPermissions fails by @erikn69 in https://github.com/spatie/laravel-permission/pull/2707Larastan in dev by @drbyte in https://github.com/spatie/laravel-permission/pull/2755Full Changelog: https://github.com/spatie/laravel-permission/compare/6.9.0...6.10.0
Use ->withPivot() for teamed relationships (allows getPivotColumns()) by @juliangums in https://github.com/spatie/laravel-permission/pull/2679
->withPivot() for teamed relationships (allows getPivotColumns()) by @juliangums in https://github.com/spatie/laravel-permission/pull/2679$role->hasPermissionTo() to include BackedEnum by @drbyte co-authored by @SanderMuller$guard_name can be an array by @angelej in https://github.com/spatie/laravel-permission/pull/2659Full Changelog: https://github.com/spatie/laravel-permission/compare/6.8.0...6.9.0
Fix can't save the same model twice by @erikn69 in https://github.com/spatie/laravel-permission/pull/2658
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.7.0...6.8.0
Fixed remaining Octane event contract. Update to #2656 in release 6.5.0
6.5.0Full Changelog: https://github.com/spatie/laravel-permission/compare/6.6.0...6.7.0
Roles: Support for casting role names to enums by @gajosadrian in https://github.com/spatie/laravel-permission/pull/2616
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.5.0...6.6.0
Octane: Fix wrong event listener by @erikn69 in https://github.com/spatie/laravel-permission/pull/2656
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.4.0...6.5.0
Add Laravel 11 to workflow run tests by @mraheelkhan in https://github.com/spatie/laravel-permission/pull/2605
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.3.0...6.4.0
Octane Fix: Clear wildcard permissions on Tick in https://github.com/spatie/laravel-permission/pull/2583
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.2.0...6.3.0
Skip duplicates on sync (was triggering Integrity Constraint Violation error) by @erikn69 in https://github.com/spatie/laravel-permission/pull/2574
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.1.0...6.2.0
Reset teamId on Octane by @erikn69 in https://github.com/spatie/laravel-permission/pull/2547 NOTE: The \Spatie\Permission\Listeners\OctaneReloadPermis
Reset teamId on Octane by @erikn69 in https://github.com/spatie/laravel-permission/pull/2547
NOTE: The \Spatie\Permission\Listeners\OctaneReloadPermissions listener introduced in 6.0.0 is removed in 6.1.0, because the logic is directly incorporated into the ServiceProvider now.
Thanks @jameshulse for the heads-up and code-review.
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.0.1...6.1.0
Provide a default team_foreign_key value in case config file isn't upgraded yet or teams feature is unused. Fixes #2535
Full Changelog: https://github.com/spatie/laravel-permission/compare/6.0.0...6.0.1
[BC] Wildcard permissions algorithm performance improvements (ALERT: Breaking Changes) by @danharrin in https://github.com/spatie/laravel-permission/p…
@haspermission directive by @axlwild in https://github.com/spatie/laravel-permission/pull/2515Full Changelog: https://github.com/spatie/laravel-permission/compare/5.11.1...6.0.0
No functional changes. Just several small updates to the Documentation.
No functional changes. Just several small updates to the Documentation.
Full Changelog: https://github.com/spatie/laravel-permission/compare/5.11.0...5.11.1
[V5] Avoid triggering eloquent.retrieved event by @erikn69 in https://github.com/spatie/laravel-permission/pull/2490
eloquent.retrieved event by @erikn69 in https://github.com/spatie/laravel-permission/pull/2490Full Changelog: https://github.com/spatie/laravel-permission/compare/5.10.2...5.11.0
Fix Eloquent Strictness on permission:show Command by @erikn69 in https://github.com/spatie/laravel-permission/pull/2457
permission:show Command by @erikn69 in https://github.com/spatie/laravel-permission/pull/2457Full Changelog: https://github.com/spatie/laravel-permission/compare/5.10.1...5.10.2
[V5] Fix artisan command permission:show output of roles with underscores by @erikn69 in https://github.com/spatie/laravel-permission/pull/2396
permission:show output of roles with underscores by @erikn69 in https://github.com/spatie/laravel-permission/pull/2396Full Changelog: https://github.com/spatie/laravel-permission/compare/5.10.0...5.10.1
Fix delete permissions on Permissions Model by @erikn69 in https://github.com/spatie/laravel-permission/pull/2366
Apologies for the break caused by 5.9.0 !
Apologies for the break caused by 5.9.0 !
Full Changelog: https://github.com/spatie/laravel-permission/compare/5.9.0...5.9.1
Add permission- prefix to publish tag names by @sedehi in https://github.com/spatie/laravel-permission/pull/2301
permission- prefix to publish tag names by @sedehi in https://github.com/spatie/laravel-permission/pull/2301getPermissionsWithRoles method. by @xiCO2k in https://github.com/spatie/laravel-permission/pull/2316Full Changelog: https://github.com/spatie/laravel-permission/compare/5.8.0...5.9.0
Laravel 10.x Support by @erikn69 in https://github.com/spatie/laravel-permission/pull/2298
Full Changelog: https://github.com/spatie/laravel-permission/compare/5.7.0...5.8.0
[Bugfix] Avoid checking permissions-via-roles on Role model (ref Model::preventAccessingMissingAttributes()) by @juliomotol in https://github.com/spat
Role model (ref Model::preventAccessingMissingAttributes()) by @juliomotol in https://github.com/spatie/laravel-permission/pull/2227Full Changelog: https://github.com/spatie/laravel-permission/compare/5.6.0...5.7.0
No longer throws an exception when checking hasAllPermissions() if the permission name does not exist by @mtawil in https://github.com/spatie/laravel-
hasAllPermissions() if the permission name does not exist by @mtawil in https://github.com/spatie/laravel-permission/pull/2248Full Changelog: https://github.com/spatie/laravel-permission/compare/5.5.16...5.6.0
optimize for loop in WildcardPermission by @SubhanSh in https://github.com/spatie/laravel-permission/pull/2113
for loop in WildcardPermission by @SubhanSh in https://github.com/spatie/laravel-permission/pull/2113Full Changelog: https://github.com/spatie/laravel-permission/compare/5.5.15...5.5.16
Autocomplete all Blade directives via Laravel Idea plugin
Autocomplete all Blade directives via Laravel Idea plugin
Full Changelog: https://github.com/spatie/laravel-permission/compare/5.5.14...5.5.15
FIXED BREAKING CHANGE. (Sorry about that!)
FIXED BREAKING CHANGE. (Sorry about that!)
Full Changelog: https://github.com/spatie/laravel-permission/compare/5.5.13...5.5.14
fix UnauthorizedException: Wrong configuration was used in forRoles by @Sy-Dante in https://github.com/spatie/laravel-permission/pull/2224
Full Changelog: https://github.com/spatie/laravel-permission/compare/5.5.12...5.5.13
Fix regression introduced in 5.5.10
Fix regression introduced in 5.5.10
Full Changelog: https://github.com/spatie/laravel-permission/compare/5.5.11...5.5.12
Support static arrays on blade directives by @erikn69 in https://github.com/spatie/laravel-permission/pull/2168
Full Changelog: https://github.com/spatie/laravel-permission/compare/5.5.10...5.5.11
Your coding agent can read these notes before it upgrades. Set up the MCP server →