Design Laravel app architecture with services, repositories, actions, and clean code patterns. Use when structuring projects, creating services, implementing DI, or organizing code layers.
View on GitHubFebruary 2, 2026
Select agents to install to:
npx add-skill https://github.com/fusengine/agents/blob/main/plugins/laravel-expert/skills/laravel-architecture/SKILL.md -a claude-code --skill laravel-architectureInstallation paths:
.claude/skills/laravel-architecture/# Laravel Architecture Patterns ## Agent Workflow (MANDATORY) Before ANY implementation, launch in parallel: 1. **fuse-ai-pilot:explore-codebase** - Analyze existing architecture 2. **fuse-ai-pilot:research-expert** - Verify Laravel patterns via Context7 3. **mcp__context7__query-docs** - Check service container and DI patterns After implementation, run **fuse-ai-pilot:sniper** for validation. --- ## Overview Laravel architecture focuses on clean separation of concerns, dependency injection, and maintainable code organization. This skill covers everything from project structure to production deployment. ### When to Use - Structuring new Laravel projects - Implementing services, repositories, actions - Setting up dependency injection - Configuring development environments - Deploying to production --- ## Critical Rules 1. **Thin controllers** - Delegate business logic to services 2. **Interfaces in app/Contracts/** - Never alongside implementations 3. **DI over facades** - Constructor injection for testability 4. **Files < 100 lines** - Split larger files per SOLID 5. **Environment separation** - .env never committed --- ## Architecture ```text app/ ├── Actions/ # Single-purpose action classes ├── Contracts/ # Interfaces (DI) ├── DTOs/ # Data transfer objects ├── Enums/ # PHP 8.1+ enums ├── Events/ # Domain events ├── Http/ │ ├── Controllers/ # Thin controllers │ ├── Middleware/ # Request filters │ ├── Requests/ # Form validation │ └── Resources/ # API transformations ├── Jobs/ # Queued jobs ├── Listeners/ # Event handlers ├── Models/ # Eloquent models only ├── Policies/ # Authorization ├── Providers/ # Service registration ├── Repositories/ # Data access layer └── Services/ # Business logic ``` --- ## Reference Guide ### Core Architecture | Reference | When to Use