0065-laravel-policies-and-authorization

Community

Standardize controller authorization with Laravel

AuthorMrJmpl3
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It reduces the risk of inconsistent or forgotten access checks by centralizing authorization logic into Laravel Policies and Gates instead of scattering checks throughout controllers and routes.

Core Features & Use Cases

  • Policies for per-model permissions: Define model-specific actions (for example, viewing, creating, updating, deleting) in dedicated policy classes and enforce them in controllers.
  • Gates for cross-cutting authorization: Use Gate checks for application-wide rules that don’t naturally belong to a single model policy.
  • Resource controller protection patterns: Protect resource controllers using authorizeResource and consistent policy method names to keep controllers clean and maintainable.

Quick Start

Generate a PostPolicy for your Post model and wire it to a resource controller so controller actions use standardized authorization checks.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: 0065-laravel-policies-and-authorization
Download link: https://github.com/MrJmpl3/codex_____data_____configuration/archive/main.zip#0065-laravel-policies-and-authorization

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.