Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Permission Laravel Package

spatie/laravel-permission

Database-backed roles and permissions for Laravel. Assign roles and permissions to users, sync them to the Gate, and check abilities with Laravel’s built-in can()/authorize features. Includes migrations, caching, teams, and flexible model setup.

View on GitHub
Deep Wiki
Context7
8.3.0

What's Changed

ALSO CHECK THE RELEASE NOTES FOR 8.2.0

Full Changelog: https://github.com/spatie/laravel-permission/compare/8.2.0...8.3.0

8.2.0

What's Changed

Watch out for in your own test suite:

  • If you use custom pivot model 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: https://github.com/spatie/laravel-permission/compare/8.1.0...8.2.0

8.1.0

What's Changed

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 removed

also

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/8.0.0...8.1.0

8.0.0
7.4.2

What's Changed

Full Changelog: https://github.com/spatie/laravel-permission/compare/7.4.1...7.4.2

7.4.1

What's Changed

Full Changelog: https://github.com/spatie/laravel-permission/compare/7.4.0...7.4.1

7.4.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/7.3.0...7.4.0

7.3.0

What's Changed

Downgraded PHP requirement to 8.3.

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/7.2.4...7.3.0

7.2.4

What's Changed

Full Changelog: https://github.com/spatie/laravel-permission/compare/7.2.3...7.2.4

6.25.0

What's Changed

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.24.1...6.25.0

7.2.3
  • Update config comments to point to new v7 event class names
7.2.2

What's Changed

Full Changelog: https://github.com/spatie/laravel-permission/compare/7.2.1...7.2.2

7.2.1

What's Changed

  • Add Laravel 13 support
  • Upgrade to laravel/passport ^13.0
  • Drop prefer-lowest from CI matrix
7.2.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/7.1.0...7.2.0

7.1.0
7.0.0

Modernize codebase for v7

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.

Version requirements

  • Requires PHP ^8.4 and Laravel ^12.0
  • Test suite uses Pest ^3.0

Service provider

  • Converted to PackageServiceProvider from spatie/laravel-package-tools
  • Removed Lumen support

Class renames

  • Event classes now have an Event suffix (PermissionAttachedPermissionAttachedEvent, etc.)
  • Command classes now have a Command suffix (CacheResetCacheResetCommand, etc.)

Type safety

  • Added return types and parameter types throughout traits, middleware, exceptions, contracts, and commands

Code modernization

  • is_a($this, X::class)$this instanceof X
  • get_class($obj)$obj::class
  • strpos($x, $y) !== falsestr_contains($x, $y)
  • Constructor promotion in WildcardPermission
  • Proper use imports for global classes

Cleanup

  • Removed deprecated clearClassPermissions() method
  • Removed __construct from Wildcard contract
  • Modernized migration stubs

Testing

  • Converted entire test suite from PHPUnit to Pest (#2912)

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.24.1...7.0.0

6.24.1

What's Changed

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.24.0...6.24.1

6.24.0

What's Changed

Internals/Testing

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.23.0...6.24.0

6.23.0

What's Changed

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.22.0...6.23.0

6.22.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.21.0...6.22.0

6.21.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.20.0...6.21.0

6.20.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.19.0...6.20.0

6.19.0

What's Changed

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.18.0...6.19.0

6.18.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.17.0...6.18.0

6.17.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.16.0...6.17.0

6.16.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.15.0...6.16.0

6.15.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.14.0...6.15.0

6.14.0

What's Changed

Internals

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.13.0...6.14.0

6.13.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.12.0...6.13.0

6.12.0

What's Changed

  • Support Laravel 12

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.11.0...6.12.0

6.11.0

What's Changed

Internals

Documentation Updates

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.10.1...6.11.0

6.10.1

What's Changed

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.10.0...6.10.1

6.10.0

What's Changed

Docs

Other

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.9.0...6.10.0

6.9.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.8.0...6.9.0

6.7.0

What's Changed

  • Fixed remaining Octane event contract. Update to #2656 in release 6.5.0

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.6.0...6.7.0

6.6.0

What's Changed

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.5.0...6.6.0

6.5.0

What's Changed

Internals

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.4.0...6.5.0

6.4.0
  • Laravel 11 Support

What's Changed

Internals

New Contributors

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.3.0...6.4.0

6.3.0

What's Changed

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.2.0...6.3.0

6.2.0

What's Changed

Full Changelog: https://github.com/spatie/laravel-permission/compare/6.1.0...6.2.0

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony