All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
[1.1.0] - 2026-07-21
Added
- Lifecycle hooks powered by
artisanpack-ui/hooks:ap.rbac.abilitiesForUserfilter — passes the resolved ability list through user-space filters, letting external packages graft permissions from LDAP, feature flags, or tenant policies onto a user without subclassing.ap.rbac.role.assignedaction — fired fromHasRoles::assignRole()after a role is attached, with(User $user, Role $role).ap.rbac.role.revokedaction — fired fromHasRoles::removeRole()after a role is detached, with(User $user, Role $role).ap.rbac.checkingAbilityaction — fired from the RBACGate::beforeshim before ability resolution, with(User $user, string $ability, mixed $arguments), giving compliance-heavy apps a low-friction audit seam.
HasPermissions::getAbilities()— returns the flat list of ability strings (names + slugs) the user can perform, after theap.rbac.abilitiesForUserfilter has run.hasPermissionTo()now resolves through this method, so grafted abilities are honored by$user->can(),Gate::allows(), and@can.
Changed
artisanpack-ui/hooks: ^1.3is now a hard dependency. The rbac package no longer works without it — hook fire sites are called unconditionally.
[1.0.1] - 2026-06-14
Added
- Laravel 13 support. The
illuminate/supportconstraint now accepts^10.0|^11.0|^12.0|^13.0, and the test toolchain (orchestra/testbench,pestphp/pest,pestphp/pest-plugin-laravel) was widened so the Laravel 13 leg installs cleanly.
Changed
- CI now runs the test suite as a matrix across Laravel 12 and 13 × PHP 8.2-8.4 (Laravel 13 / PHP 8.2 excluded — Laravel 13 requires PHP 8.3+). CI also triggers on
release/**branches and overridescomposer config platform.phpper matrix row so the Laravel 13 leg resolves correctly despite the repo's PHP 8.2 platform pin.
[1.0.0] - 2026-05-18
Added
- Initial release of the standalone RBAC package, extracted from
artisanpack-ui/security1.x as part of the Security 2.0 package split. RoleEloquent model with parent / child hierarchy, name + auto-derived slug, optional description, and collision-detectingsave().PermissionEloquent model with name + auto-derived slug and collision-detectingsave().HasRolesuser trait:roles()relationship,hasRole(),assignRole(),removeRole()helpers; idempotent assignment and removal.HasPermissionsuser trait:hasPermissionTo()(recursive resolution through the role hierarchy),hasPermission()alias,flushPermissionCache()manual invalidation.permissionroute middleware alias (permission:posts.publish,posts.review) — accepts one or more permission slugs and aborts 401 / 403 as appropriate.@roleand@permissionBlade directives for view-layer permission gating.- Gate integration via
Gate::beforeso$user->can('slug'),Gate::allows('slug'), and@can('slug')resolve through RBAC permissions while still falling through to standard policies for non-RBAC abilities. - Artisan commands:
role:create,permission:create,user:assign-role,user:revoke-role— idempotent and configurable user lookup fields. - Eloquent observers dispatching
rbac.role.{created,updated,deleted}andrbac.permission.{created,updated,deleted}events for downstream auditing. - Pivot events
rbac.user.role_assignedandrbac.user.role_removeddispatched directly from theHasRolestrait. - Migrations for
roles,permissions,role_user, andpermission_roletables. - Configurable model bindings (
artisanpack.rbac.models.role/permission) so downstream packages can extend the base models without forking. - Configurable table names, foreign keys, and user lookup fields for legacy schema integration.
- Permission-name cache backed by Laravel's tagged cache where available, with automatic invalidation on permission CRUD; user-permission cache with configurable TTL.
RbacFacade andrbac()helper as the public entry point for future API expansion.
Changed
- (none — initial release)
Removed
- This package contains the role / permission / Blade directive / Gate integration content previously bundled in
artisanpack-ui/security1.x. See theartisanpack-ui/securityUPGRADE guide for migration instructions from 1.x.

