No slash command · from fuse-laravel
Covers Spatie Laravel Permission for RBAC: roles, permissions, route middleware, Blade directives, multi-tenant teams, wildcard permissions, super-admin bypass, cache management, query scopes, event audit logging, Policy integration, Sanctum/Passport API usage, custom models, and testing patterns.
Ships in fuse-laravel. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
After implementation, run fuse-ai-pilot:sniper for validation.
Spatie Laravel Permission provides complete role-based access control (RBAC) for Laravel applications.
| Component | Purpose |
|---|---|
| Role | Group of permissions (admin, writer) |
| Permission | Single ability (edit articles) |
| Middleware | Route protection |
| Blade Directives | UI authorization |
| Teams | Multi-tenant scoping |
| Wildcards | Hierarchical permissions |
| Super Admin | Bypass all checks |
| Events | Audit logging (v6.15.0+) |
| Query Scopes | Filter users by role/permission |
| API Support | Sanctum/Passport integration |
| Policies | Resource-based authorization |
DatabaseSeederphp artisan permission:cache-resetedit-articlespermission:edit,api| Topic | Reference | When to consult |
|---|---|---|
| Setup | spatie-permission.md | Installation, model setup, core methods |
| Middleware | middleware.md | Route protection patterns |
| Blade | blade-directives.md | UI authorization directives |
| Direct vs Role | direct-permissions.md | Permission inheritance |
| Topic | Reference | When to consult |
|---|---|---|
| Teams | teams.md | Multi-tenant permissions |
| Wildcards | wildcard-permissions.md | Hierarchical patterns |
| Super Admin | super-admin.md | Bypass all permissions |
| Custom Models | custom-models.md | UUID, extending models |
| Topic | Reference | When to consult |
|---|---|---|
| API Usage | api-usage.md | Sanctum, guards, JSON responses |
| Policies | policies.md | Laravel Policy integration |
| Query Scopes | query-scopes.md | User::role(), User::permission() |
| Events | events.md | Audit logging, notifications |
| Topic | Reference | When to consult |
|---|---|---|
| Cache | cache.md | Performance, debugging |
| CLI | artisan-commands.md | Artisan commands |
| Testing | testing.md | Tests, factories, setup |
| Performance | performance.md | Optimization, N+1, caching |
| Template | Purpose |
|---|---|
| UserModel.php.md | User model with HasRoles trait |
| RoleSeeder.php.md | Basic role seeding |
| PermissionSeeder.php.md | Permission creation seeder |
| WildcardSeeder.php.md | Hierarchical permissions |
| Template | Purpose |
|---|---|
| routes-example.md | Protected routes examples |
| ControllerMiddleware.php.md | Middleware in controllers |
| BladeExamples.blade.md | Blade directive examples |
| Template | Purpose |
|---|---|
| TeamMiddleware.php.md | Multi-tenant middleware |
| TeamSeeder.php.md | Team-scoped roles seeder |
| TeamModel.php.md | Team model with boot |
| Template | Purpose |
|---|---|
| SuperAdminSetup.php.md | Gate::before bypass |
| CacheConfig.php.md | Cache configuration |
| DeployScript.sh.md | CI/CD cache management |
| Template | Purpose |
|---|---|
| ApiPermissionSetup.php.md | API guard + Sanctum |
| ApiExceptionHandler.php.md | JSON error responses |
| ApiUserResource.php.md | User resource with permissions |
| Template | Purpose |
|---|---|
| PostPolicy.php.md | Policy with Spatie integration |
| PermissionEventListener.php.md | Audit event listeners |
| UserQueryExamples.php.md | Query scope examples |
| PermissionAudit.php.md | Audit service |
| Template | Purpose |
|---|---|
| PermissionTest.php.md | Pest & PHPUnit tests |
| UserFactory.php.md | Factory with permission states |
| Template | Purpose |
|---|---|
| CustomRole.php.md | Extended Role model |
| CustomPermission.php.md | Extended Permission model |
| UUIDMigration.php.md | UUID tables migration |
| SetupPermissions.php.md | Custom artisan command |
$user->assignRole('admin');
$user->can('edit articles');
Route::middleware(['role:admin'])->group(fn () => ...);
Route::middleware(['auth:sanctum', 'permission:edit,api'])->group(fn () => ...);
@role('admin') ... @endrole
@can('edit articles') ... @endcan
User::role('admin')->get();
User::permission('edit articles')->get();
setPermissionsTeamId($team->id);
$role->givePermissionTo('articles.*');
Gate::before(fn ($user, $ability) =>
$user->hasRole('Super-Admin') ? true : null
);
beforeEach(fn () => app(PermissionRegistrar::class)->forgetCachedPermissions());
| Feature | Status | Reference |
|---|---|---|
| Basic RBAC | ✅ | spatie-permission.md |
| Middleware | ✅ | middleware.md |
| Blade Directives | ✅ | blade-directives.md |
| Multi-Guard (web/api) | ✅ | middleware.md, api-usage.md |
| Teams (Multi-Tenant) | ✅ | teams.md |
| Wildcard Permissions | ✅ | wildcard-permissions.md |
| Super Admin | ✅ | super-admin.md |
| Cache Management | ✅ | cache.md |
| Direct vs Role Perms | ✅ | direct-permissions.md |
| Artisan Commands | ✅ | artisan-commands.md |
| UUID Support | ✅ | custom-models.md |
| Custom Models | ✅ | custom-models.md |
| Events (v6.15.0+) | ✅ | events.md |
| Query Scopes | ✅ | query-scopes.md |
| Policy Integration | ✅ | policies.md |
| API / Sanctum | ✅ | api-usage.md |
| Testing | ✅ | testing.md |
| Performance | ✅ | performance.md |
Spatie Permission 8.x (current 8.5, requires PHP 8.3+ and Laravel 12/13) is Laravel 13 compatible. L13 integrations:
Event (RoleAttachedEvent…), commands suffixed Command, clearClassPermissions() removed, findByName() / findOrCreate() accept BackedEnum|string (v8) — see events.mdpermission.cache.key key stays explicit (spatie.permission.cache) in config/permission.php → unaffected by L13's switch to hyphenated prefixes#[Authorize] (policy) and #[Middleware('role:admin')] (RBAC), namespace Illuminate\Routing\Attributes\Controllers — see [[laravel-blade]]final readonly class for custom Role/Permission DTOs#[Middleware(['auth', 'role:admin|editor'])]
#[Authorize('update', 'post')]
public function update(UpdatePostRequest $request, Post $post) { /* ... */ }
permission:create-post (verb-noun) for clarityteams only for genuine multi-tenancyCache::remember('user.permissions.'.$id, ...))Gate::before() (never via a * wildcard permission)hasRole() and hasPermissionTo() without a consistent architectureRoleEnum enum)assignRole() in a seeder* to a super admin (prefer a targeted Gate::before())references/api-usage.md (opens in a new tab)references/artisan-commands.md (opens in a new tab)references/blade-directives.md (opens in a new tab)references/cache.md (opens in a new tab)references/custom-models.md (opens in a new tab)references/direct-permissions.md (opens in a new tab)references/events.md (opens in a new tab)references/middleware.md (opens in a new tab)references/performance.md (opens in a new tab)references/policies.md (opens in a new tab)references/query-scopes.md (opens in a new tab)references/spatie-permission.md (opens in a new tab)references/super-admin.md (opens in a new tab)references/teams.md (opens in a new tab)references/templates/ApiExceptionHandler.php.md (opens in a new tab)references/templates/ApiPermissionSetup.php.md (opens in a new tab)references/templates/ApiUserResource.php.md (opens in a new tab)references/templates/BladeExamples.blade.md (opens in a new tab)references/templates/CacheConfig.php.md (opens in a new tab)references/templates/ControllerMiddleware.php.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
23 skills in this plugin
/fusecoreUse when creating modules, understanding FuseCore structure, or implementing features in a FuseCore modular-monolith Laravel project./laravel-ai-sdkUse when integrating AI agents, tool calling, embeddings, structured output, or streaming in Laravel 13 via the `laravel/ai` package./laravel-apiUse when creating API endpoints, transforming responses with API Resources, or handling API authentication, rate limiting, or versioning.npx claudepluginhub fusengine/claude-plugins --plugin fuse-laravelOther plugins' skills for the same job