laravel-patterns

Solid

Laravel architecture patterns, routing/controllers, Eloquent ORM, service layers, queues, events, caching, and API resources for production apps.

AI & Automation 196,640 stars 30253 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 96/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Laravel Development Patterns Production-grade Laravel architecture patterns for scalable, maintainable applications. ## When to Use - Building Laravel web applications or APIs - Structuring controllers, services, and domain logic - Working with Eloquent models and relationships - Designing APIs with resources and pagination - Adding queues, events, caching, and background jobs ## How It Works - Structure the app around clear boundaries (controllers -> services/actions -> models). - Use explicit bindings and scoped bindings to keep routing predictable; still enforce authorization for access control. - Favor typed models, casts, and scopes to keep domain logic consistent. - Keep IO-heavy work in queues and cache expensive reads. - Centralize config in `config/*` and keep environments explicit. ## Examples ### Project Structure Use a conventional Laravel layout with clear layer boundaries (HTTP, services/actions, models). ### Recommended Layout ``` app/ ├── Actions/ # Single-purpose use cases ├── Console/ ├── Events/ ├── Exceptions/ ├── Http/ │ ├── Controllers/ │ ├── Middleware/ │ ├── Requests/ # Form request validation │ └── Resources/ # API resources ├── Jobs/ ├── Models/ ├── Policies/ ├── Providers/ ├── Services/ # Coordinating domain services └── Support/ config/ database/ ├── factories/ ├── migrations/ └── seeders/ resources/ ├── views/ └── lang/ routes/ ├── api.php ├── web.php └── console.php ``` ### Controllers -> Servi...

Details

Author
affaan-m
Repository
affaan-m/everything-claude-code
Created
4 months ago
Last Updated
2 days ago
Language
JavaScript
License
MIT

Integrates with

Related Skills