LA

laravel-architecture

Provides architectural patterns and standards for building scalable Laravel applications.

Install

mkdir -p .claude/skills/laravel-architecture && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1876" && unzip -o skill.zip -d .claude/skills/laravel-architecture && rm skill.zip

Installs to .claude/skills/laravel-architecture

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Enforce core architectural standards for scalable Laravel applications. Use when structuring controllers, service layers, action classes, Form Requests, or Service Container bindings in Laravel projects.
203 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Structure controllers, services, and action classes
  • Implement Form Requests for validation
  • Bind interfaces in the Service Container
  • Refactor legacy codebases to scalable patterns

How it works

The skill enforces a strict architectural pattern where controllers are kept slim, logic is moved to Action classes, and dependencies are managed via the Service Container.

Inputs & outputs

You give it
Business logic requirements
You get back
Architected Laravel classes and service bindings

When to use laravel-architecture

  • Structuring a new Laravel project
  • Refactoring legacy Laravel codebases
  • Applying design patterns to Laravel services

About this skill

Laravel Architecture

Priority: P0 (CRITICAL)

Structure

See project structure for recommended directory layout.

Workflow

  1. Create Form Request for validation (php artisan make:request StoreUserRequest).
  2. Create Action class with single handle() method for use case.
  3. Inject Action into controller via constructor DI.
  4. Bind interfaces in AppServiceProvider for swappable implementations.

Controller Pattern

See implementation examples for slim controller, action class, and service container binding patterns.

Validation

  • Use Form Requests with authorize() and rules() methods.
  • Call $request->validated() in controller for mass assignment.
  • Never use inline $request->validate().

Anti-Patterns

  • No logic in Controllers: Move to Services or Action classes.
  • No manual instantiation: Use Service Container via DI.
  • No inline $request->validate(): Favor Form Request classes.
  • No excessive global helpers: Use class-based logic instead.

References

Canonical response anchors

When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:

  • No logic in

  • Additional task-grounded exact anchors: handle()

When not to use it

  • Writing logic directly inside controllers
  • Using inline request validation

Prerequisites

Laravel framework

Limitations

  • Requires adherence to specific directory structures
  • Action classes must use a single handle() method

How it compares

It mandates a specific separation of concerns that prevents the common anti-pattern of bloated controllers in Laravel.

Compared to similar skills

laravel-architecture side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
laravel-architecture (this skill)71moNo flagsIntermediate
php-best-practices151moNo flagsBeginner
php-guidelines-from-spatie66moNo flagsBeginner
fluent-validation-migrate-messages01moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry