Laravel Mandate

Automates RBAC role and permission management in Laravel applications using PHP and code-first definitions.

7|Updated Dec 16, 2025
One-click install
npx skills add https://github.com/offload-project/laravel-mandate --skill laravel-mandate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Laravel Mandate
Source: https://github.com/offload-project/laravel-mandate/tree/main/skills
Command: npx skills add https://github.com/offload-project/laravel-mandate --skill laravel-mandate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the process of implementing role-based access control (RBAC) in Laravel applications, streamlining the management of roles, permissions, and capabilities.

Core Features & Use Cases

  • Role Management: Assign roles to users and define permissions within those roles.
  • Permission Management: Grant permissions to roles or directly to users for fine-grained access control.
  • Capability Management: Group permissions into capabilities for cleaner authorization logic.
  • Multi-Tenancy: Scope roles and permissions to specific tenant contexts like teams or projects.
  • Feature Integration: Delegate feature access checks to external packages.
  • Code-First Definitions: Define permissions, roles, and capabilities in PHP classes with attributes.
  • Use Case: A project manager can use this Skill to define roles for team members, assign permissions, and ensure that only authorized users can access sensitive project data.

Quick Start

Run the 'mandate:sync' command to sync your code-first definitions of roles, permissions, and capabilities with the database.

Frequently Asked Questions about Laravel Mandate

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

FAQPage Schema
How do I implement role-based access control in a Laravel application?

Role-based access control in Laravel is implemented by defining roles, permissions, and capabilities in PHP classes. You can group permissions into capabilities and run the 'mandate:sync' command to synchronize these code-first definitions directly with your database.

Can I scope Laravel permissions to specific teams or projects for multi-tenancy?

Yes, Laravel permissions and roles can be scoped to specific tenant contexts like teams or projects. This multi-tenancy feature ensures that authorization checks and access rights are isolated to the appropriate tenant boundaries.

What's the best way to define Laravel roles and permissions using a code-first approach?

The best way to define roles and permissions code-first is by using PHP classes with attributes. This approach allows you to declare capability groupings and fine-grained access rules directly in your code before syncing them to the database.

Do I need a specific PHP and Laravel version to use code-first permission management?

Yes, code-first permission management requires Laravel 11, 12, or 13 and PHP 8.2 or higher. You need this environment to properly support the PHP class attributes used for defining roles and capabilities.

How does capability grouping work for Laravel authorization logic?

Capability grouping works by bundling multiple individual permissions into a single capability. This results in cleaner authorization logic, allowing you to grant a grouped capability to a role or user instead of assigning many granular permissions individually.

Can I delegate Laravel feature access checks to external packages?

Yes, you can delegate feature access checks to external packages. This feature integration allows your Laravel application's authorization system to rely on external logic for specific access control decisions when needed.