NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1872 most downloaded on Packagist
This package provides a flexible way to add Role-based Permissions to Laravel
Latest stable
9.0.0
Last release 12 days ago
10 Nov 2026
Release timing varies
gaps range from 1 weeks to 10 months
Some releases are documented
notes for 32 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
99 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
> This release has breaking changes. Read the [upgrade guide](https://laratrust.santigarcor.me/docs/9.x/upgrade.html) before you upgrade. Most apps on…
Laratrust 9 is a new major version for Laravel 13 and PHP 8.3+. Permission checks are much faster, the API is cleaner, a long list of bugs is fixed, and the admin panel is rebuilt.
[!IMPORTANT] This release has breaking changes. Read the upgrade guide before you upgrade. Most apps only need the required steps: update composer, republish the config, clear the caches and, if you use the admin panel, define the
viewLaratrustgate.If you can't move to PHP 8.3 and Laravel 13 yet, stay on 8.x, which supports Laravel 10 to 13.
hasPermission() calls don't query the database again.laratrustCacheKey() on your user and role models (#705).Laratrust::reset() forgets the loaded data in long-running processes.RoleAdded, RoleRemoved, RoleSynced, PermissionAdded, PermissionRemoved and PermissionSynced in Laratrust\Events. Listen to them like any other Laravel event.Role::with('users')->get() works for every model in user_models.Blade::if, so @elserole, @unlessrole and the same forms of @permission and @ability work.#[Scope] attribute.guard:web|admin checks the user of the first authenticated guard, like Laravel's auth middleware (#488).__() (#650).Role::using(), Permission::using() and Ability::using() build the middleware strings, e.g. Role::using('admin', team: 'acme', guards: ['web', 'admin']).viewLaratrust gate protects the panel, and by default allows only the local environment.create_permissions and not_removable are now checked on save, and the submitted keys are validated.composer serve in the repository to open the panel with demo data.whereHasRole() and whereHasPermission() (#695).allPermissions($team) and whereHasPermission() now apply the team to the pivot tables.whereDoesntHavePermissions() returns only the users without any permission, direct or through a role.whereHasRole(), whereHasPermission() and Role::hasPermission() split pipe-separated names.addRole() and givePermission() do nothing when the assignment already exists. In 8.x they could fail on the primary key.permissions_as_gates, can('edit', $post) and can('create', Post::class) no longer treat the post or the class as the team.$table property.query checkers, custom checkers and the checkers config.flushCache(): use flushLaratrustCache().laratrust:add-trait and laratrust:upgrade commands, and Laratrust\Helper.laratrustObserve() and the static event listeners.laratrust-assets publish tag.laratrust:seeder always writes to database/seeders.Full list of changes: CHANGELOG.md · Upgrade guide: 8.x → 9.x
Your coding agent can read these notes before it upgrades. Set up the MCP server →
query checkers, the custom checkers and the checkers configurationlaratrustCacheKey() to the user and role models to customize the cache keys (#705)laratrustObserve() with the Laratrust\Events event classesresolveRelationUsing, so they can be eager loadedBlade::if, adding @elserole, @unlessrole and the like#[Scope] attribute for the query scopeswhereHasRole and whereHasPermission (#695)allPermissions($team) and whereHasPermission to apply the team to the pivot tableswhereDoesntHavePermissions to return only the users without any permissionLaratrust::reset() to forget the loaded roles and permissions in long-running processesaddRole() and givePermission() idempotentremoveRole() and removePermission() do nothing, and dispatch no event, when the assignment doesn't existcan(), like Post::class, for the team in the permissions-as-gates checksremoveRoles() and removePermissions() require the list, and remove nothing when it's emptywhereHasRole() and whereHasPermission()guard:web|admin (#488)Role::using(), Permission::using() and Ability::using() middleware helpers$table property of the role, permission and team modelsRole::hasPermission()database/seedersflushCache(), laratrust:add-trait, laratrust:upgrade and Laratrust\Helperpanel.create_permissions option on the panel routesviewLaratrust gate, which only allows the local environment by defaultnot_removable role restriction and validate the submitted keys in the panelfix: Prevent override of default make:seeder command by @hawkiq in https://github.com/santigarcor/laratrust/pull/709
Full Changelog: https://github.com/santigarcor/laratrust/compare/8.5.5...8.5.6
fix removal of many-to-many records when deleting user by fixing HasRolesAndPermissions boot method name by @sidneygijzen in https://github.com/santig
Full Changelog: https://github.com/santigarcor/laratrust/compare/8.5.4...8.5.5
Laravel 13.x Compatibility by @laravel-shift in https://github.com/santigarcor/laratrust/pull/704
Full Changelog: https://github.com/santigarcor/laratrust/compare/8.5.3...8.5.4
Full Changelog: https://github.com/santigarcor/laratrust/compare/8.5.2...8.5.3
Full Changelog: https://github.com/santigarcor/laratrust/compare/8.5.2...8.5.3
Full Changelog: https://github.com/santigarcor/laratrust/compare/8.5.1...8.5.2
Full Changelog: https://github.com/santigarcor/laratrust/compare/8.5.1...8.5.2
Document 'doesntHavePermission' and 'isNotAbleTo' methods by @gdebrauwer in https://github.com/santigarcor/laratrust/pull/697
Full Changelog: https://github.com/santigarcor/laratrust/compare/8.5.0...8.5.1
Add doesntHavePermission and isNotAbleTo methods by @gdebrauwer in https://github.com/santigarcor/laratrust/pull/696
doesntHavePermission and isNotAbleTo methods by @gdebrauwer in https://github.com/santigarcor/laratrust/pull/696Full Changelog: https://github.com/santigarcor/laratrust/compare/8.4.1...8.5.0
Fix implicitly nullable parameter by @RazeSoldier in https://github.com/santigarcor/laratrust/pull/690
Full Changelog: https://github.com/santigarcor/laratrust/compare/8.4.0...8.4.1
Fix php 8.4 deprecated types by @incoming-th in https://github.com/santigarcor/laratrust/pull/688
Full Changelog: https://github.com/santigarcor/laratrust/compare/8.3.1...8.4.0
Full Changelog: 8.3.1...8.4.0
Fix php 8.4 deprecated types by @incoming-th in https://github.com/santigarcor/laratrust/pull/688
Full Changelog: https://github.com/santigarcor/laratrust/compare/8.3.0...8.3.2
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add possibility to pass extra params to the permissions as gates as the team and requireAll.
- Add backed enums support #627 - Fix wrong import in stub #629
Nothing published for this version
Type hints compatible with latest PHP
Nothing published for this version
Nothing published for this version
Bump kkszymanowski/traitor version
Don't use cache in non production environments #545
Possibility to add permissions from the panel.
Nothing published for this version
Nothing published for this version
Publish the seeder configuration as a separate resource
permissionsTeams relationship and allTeams methodallPermissions methodProblem when generating the database seeder #453
Nothing published for this version
Possibility to get specific columns from the allPermissions method.
allPermissions method. (4321da77393bdbc21a7cf791578da3c243921c38)Change how the seeder creates permissions names.
::class syntax in the config file by default.This release enables the possibility to add restriction to roles in the admin panel. Now you can define which roles shouldn't be editable, removable o
This release enables the possibility to add restriction to roles in the admin panel. Now you can define which roles shouldn't be editable, removable or deletable in the admin panel.
In order to use this feature if you installed the 6.0 version you simply have to add this to the panel section in your config/laratrust.php file:
/*
|--------------------------------------------------------------------------
| Add restriction to roles in the panel
|--------------------------------------------------------------------------
|
| Configure which roles can not be editable, deletable and removable.
| To add a role to the restriction, use name of the role here.
|
*/
'roles_restrictions' => [
// The user won't be able to remove roles already assigend to users.
'not_removable' => [],
// The user won't be able to edit the role and the permissions assigned.
'not_editable' => [],
// The user won't be able to delete the role.
'not_deletable' => [],
],
Merge pull request #411 from siarheipashkevich/fix-config-typos
Don't register the panel by default
Add simple admin panel to manage roles, permissions and roles/permissions assignment to the users
can method so we now support gates and policies out of the boxwithoutRole and withoutPermission scopeswhereRoleIs and wherePermissionIs methods.Nothing published for this version
Nothing published for this version
Rollback teams' foreign keys and table in migrations
Method to get (cached) roles of user
Provide option to allow the response text when using abort handler
Nothing published for this version
Nothing published for this version
Ability returning false when using teams and validate all. #348
Removing Laratrust observables #339
Nothing published for this version
Add two types of permissions/roles checkers, the default one we have always used and another one directly doing queries to the DB.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Added syncRolesWithoutDetaching and syncPermissionsWithoutDetaching methods.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.