Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

laravel-permission-development

Skill by spatie

Guides work with Spatie Laravel Permission for roles, permissions, middleware, policies, teams and Blade directives. It is for Laravel developers who need to add or review access control in their apps.

  • Score 91
  • 13k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install laravel-permission-development

Built from the published package, never by AI.

git clone --depth 1 https://github.com/spatie/laravel-permission /tmp/laravel-permission && mkdir -p ~/.claude/skills && cp -r /tmp/laravel-permission/resources/boost/skills/laravel-permission-development ~/.claude/skills/laravel-permission-development

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install laravel-permission-development in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill gives an AI assistant guidance for building authorization in Laravel with the spatie/laravel-permission package. It covers the core model where users have roles, roles have permissions, and apps check permissions. It includes code patterns for creating and assigning roles and permissions, checking them with the can method and package helpers, and using query scopes.

The skill also covers route middleware aliases, Blade directives such as @can and @hasanyrole, a Super Admin setup using Gate::before, and policy examples. It describes enums, seeders that flush the permission cache, teams for multi-tenant apps, and optional events. It is aimed at Laravel developers who maintain or extend role-based access in their applications.

Written from the project's SKILL.md and checked against it.

What it can do

  • Create roles and permissionsCreates roles and permissions with create or findOrCreate, which is safe to run in seeders.
  • Assign roles and permissionsAssigns, syncs and removes roles on users and permissions on roles.
  • Check accessChecks permissions with can and canAny, plus role checks such as hasRole and hasAnyRole.
  • Query users by role or permissionUses scopes like role, permission and withoutRole to filter users.
  • Route middlewareProtects routes with role, permission and role_or_permission middleware, including OR logic.
  • Blade directivesShows or hides template content with @can, @canany, @role and @hasanyrole.
  • Super Admin setupGrants all abilities to a Super Admin role through Gate::before in AppServiceProvider.
  • Policy examplesWrites policy methods that call the can method for permission-based checks.
  • Teams supportEnables multi-tenant team scoping and explains how to switch the active team.
  • Seeding and cacheProvides a seeder pattern that flushes the permission cache before creating records.

What you need

  • A Laravel project
  • The spatie/laravel-permission package
  • A User model using the HasRoles trait

Try asking

  • Add a Super Admin gate to my AppServiceProvider using spatie permissions
  • Protect my admin routes with the role middleware for the admin role
  • Write a seeder that creates writer and editor roles with article permissions

Good to know

  • Direct permissions on users are described as an anti-pattern, so permissions should go through roles.
  • Methods like hasPermissionTo bypass the Gate and do not support Super Admin.
  • Teams must be enabled in config before running migrations.
  • Events must be enabled in config before they fire.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: resources/boost/skills/laravel-permission-development/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md7 KB

Alternatives to laravel-permission-development

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

laravel-permission-development: common questions

Should I give permissions directly to users?

The skill says no. Direct permissions on users are an anti-pattern, so permissions should be assigned to roles instead.

Which check should I use in my code?

The skill recommends $user->can() for all authorization checks, because it supports Super Admin through the Gate.

How do I handle multiple tenants?

Enable teams in config/permission.php before migrating, then set the active team with setPermissionsTeamId in middleware.

How do I install laravel-permission-development?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is laravel-permission-development free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is laravel-permission-development safe to use?

It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to laravel-permission-development?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

laravel-permission-development Install

Add to stack

Loading.