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
PackageServiceProviderfromspatie/laravel-package-tools - Removed Lumen support
Class renames
- Event classes now have an
Eventsuffix (PermissionAttached→PermissionAttachedEvent, etc.) - Command classes now have a
Commandsuffix (CacheReset→CacheResetCommand, 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 Xget_class($obj)→$obj::classstrpos($x, $y) !== false→str_contains($x, $y)- Constructor promotion in
WildcardPermission - Proper
useimports for global classes
Cleanup
- Removed deprecated
clearClassPermissions()method - Removed
__constructfromWildcardcontract - Modernized migration stubs
Testing
- Converted entire test suite from PHPUnit to Pest (#2912)
Full Changelog: 6.24.1...7.0.0