mcpField
L
laravel-architecture

laravel-architecture

github.com/leeoveryDevelopment4399 installsUpdated 32w ago
Repository

About laravel-architecture

Architectural guidance for developers building Laravel applications. It explains when to use patterns such as Actions, DTOs, state machines, and Services, alongside project structure, examples, and implementation checklists.

Key features

  1. 01Guidance on architectural principles
  2. 02Pattern selection and trade-offs
  3. 03Laravel project structure conventions
  4. 04Reference implementations and workflows
  5. 05Implementation and deployment checklists

Use cases

  1. 01Choosing a pattern for domain logic
  2. 02Organizing a Laravel project
  3. 03Designing multi-step processes
  4. 04Planning feature implementation

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/leeovery/claude-laravel --skill laravel-architecture

After installing, type/laravel-architecturein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
checklist.md
decisions.md
examples.md
patterns.md
philosophy.md
structure.md

Details

From the project README

Laravel Architecture

High-level architectural guidance for Laravel applications.

Core Concepts

philosophy.md - Foundational principles:

  • Declarative code above all else
  • Strict separation of concerns
  • Type safety first
  • All core architectural principles

patterns.md - Pattern overview:

  • Actions for domain logic
  • DTOs for data transfer
  • State machines for complex state
  • Services for external integration
  • Workflows for multi-step processes
  • Value objects for domain values

decisions.md - Pattern selection:

  • When to use each pattern
  • Decision flowcharts
  • Architectural trade-offs
  • Common scenarios

structure.md - Directory structure:

  • Complete project organization
  • File placement rules
  • Namespace conventions
  • Web vs API distinction

examples.md - Reference implementations:

  • Complete working examples
  • End-to-end workflows
  • Real-world patterns

checklist.md - Implementation checklist:

  • Setup tasks
  • Feature development workflow
  • Production deployment steps

Core Principles

  1. Actions contain domain logic - Business logic lives in invokable action classes
  2. Never pass primitives - Always use DTOs for data transfer
  3. Thin HTTP layer - Controllers only handle HTTP concerns
  4. Custom query builders - Type-safe queries over scopes
  5. Strict typing - declare(strict_types=1) in every file

Quick Decision Tree

Need to...

  • Handle domain logic? → Action
  • Transfer data? → DTO
  • Validate user input? → Form Request
  • Simple state field? → Enum
  • Complex state transitions? → State Machine
  • External API? → Service with Saloon
  • Background processing? → Job (delegates to Action)

Read decision flowcharts in decisions.md for detailed guidance.

Comments

Markdown supported