laravel-permission-development

Manage Laravel roles and permissions with Spatie's package.

13.0k|1.8k|Updated Sep 14, 2015
One-click install
npx skills add https://github.com/spatie/laravel-permission --skill laravel-permission-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-permission-development
Source: https://github.com/spatie/laravel-permission/tree/main/resources/boost/skills/laravel-permission-development
Command: npx skills add https://github.com/spatie/laravel-permission --skill laravel-permission-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Centralize and simplify authorization in Laravel by modeling roles, permissions, and access controls using Spatie's Laravel Permission package.

Core Features & Use Cases

  • Setup and integrate Spatie Laravel Permission to manage roles and permissions across Laravel apps.
  • Define roles and permissions, assign to users, and enforce access via Gate-based checks and blade directives.
  • Support middleware guards, policies, and team-aware multi-tenancy for scalable access control.

Quick Start

Install and configure Spatie Laravel Permission, add the HasRoles trait to your User model, then create roles and permissions and assign them to users.

Frequently Asked Questions about laravel-permission-development

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

FAQPage Schema
How do I set up roles and permissions in Laravel using Spatie?

To set up Laravel permissions using Spatie, install the package, configure it, add the HasRoles trait to your User model, then create and assign roles and permissions to users for access control.

Can I enforce Laravel permissions with middleware and blade directives?

Yes, Laravel permissions can be enforced using middleware guards for route protection and blade directives for UI-level access control, ensuring granular role-based checks across the application.

Does Spatie Laravel Permission support team-aware multi-tenancy?

Spatie Laravel Permission supports team-aware multi-tenancy, allowing you to assign roles and permissions within specific team contexts for scalable, segmented access control across multiple teams.

What is the best way to manage granular access control in Laravel applications?

The best way to manage granular access control in Laravel is by centralizing authorization through defined roles and permissions, enforcing them via Gate-based checks, policies, and middleware.

How do I check user permissions in Laravel policies and gates?

You can check user permissions in Laravel by utilizing Gate-based checks and policies, verifying assigned roles and permissions to determine access to specific resources and actions.

Why assign roles to users instead of individual permissions in Laravel?

Assigning roles to users in Laravel centralizes authorization by grouping related permissions, simplifying access management and enforcement across teams, middleware, and blade directives.