laravel-permission

Implements RBAC in Laravel apps using Spatie's permission package with roles, middleware, Blade directives, teams, wildcards, super-admin bypass, and API auth.

22|3|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/fusengine/agents --skill laravel-permission
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-permission
Source: https://github.com/fusengine/agents/tree/main/plugins/laravel-expert/skills/laravel-permission
Command: npx skills add https://github.com/fusengine/agents --skill laravel-permission

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust framework for implementing Role-Based Access Control (RBAC) in Laravel applications, ensuring secure and granular user authorization.

Core Features & Use Cases

  • Role & Permission Management: Define and assign roles (e.g., 'admin', 'editor') and individual permissions (e.g., 'edit articles').
  • Route Protection: Secure your application's routes using middleware based on roles and permissions.
  • UI Authorization: Control visibility of UI elements using Blade directives (@can, @role).
  • Advanced Features: Supports multi-guard systems, teams (multi-tenancy), wildcard permissions, and super-admin bypass.
  • Use Case: Implement a content management system where 'writers' can create and edit articles, 'editors' can publish them, and 'admins' can manage users and settings.

Quick Start

Use the laravel-permission skill to assign the 'admin' role to the current user.

Frequently Asked Questions about laravel-permission

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement role-based access control in Laravel using Spatie?

Implement role-based access control in Laravel using Spatie by defining roles and permissions, assigning them to users, and securing routes with middleware. This provides granular user authorization for web and API guards.

How do I protect Laravel routes with role and permission middleware?

Protect Laravel routes with role and permission middleware by assigning specific access rules to your endpoints. This ensures only users with the correct authorization roles can access secured application routes.

Can I use Laravel Blade directives to check user permissions in the UI?

Yes, you can use Laravel Blade directives to check user permissions in the UI. Directives like `@can` and `@role` allow you to control the visibility of UI elements based on the current user's assigned roles.

Does the Spatie Laravel permission package support multi-tenancy and teams?

Yes, the Spatie Laravel permission package supports multi-tenancy through its teams feature. It also handles wildcard permissions and super-admin bypass for advanced authorization scenarios across different guards.

What is the best way to structure roles and permissions in a Laravel content management system?

The best way to structure roles and permissions in a Laravel CMS is to assign granular permissions like 'edit articles' to specific roles like 'writers' or 'editors', while reserving 'admin' for user and settings management.

How do I secure API endpoints with Laravel RBAC and multiple guards?

Secure API endpoints with Laravel RBAC by integrating the authorization package with your API guards. This validates user permissions and roles before granting access to protected API routes and resources.