
Laravel Patterns
This walks you through production Laravel architecture: controllers stay thin, orchestration goes in services, single-purpose logic in actions, and everything flows through clear layer boundaries. You get specific patterns for route model binding with scopes to prevent cross-tenant access, Eloquent conventions like typed casts and query scopes to keep domain logic out of controllers, and practical examples for queues, events, and caching. The routing section is especially useful if you've ever tangled yourself in nested resource routes or wondered when to use explicit bindings. It's opinionated about structure but in a way that makes refactoring easier six months later. Good for teams that want consistency without fighting the framework.
- skills.sh installs
- 6.1K
- GitHub stars
- 300.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add affaan-m/ecc --skill laravel-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
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
Sponsors
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Backend & APIs, Code Review & Quality, PHP & Laravel, Databases
- First seen
- Jul 14, 2026
More from affaan-m/ecc
All 263- Rust Patterns6.1K
- Springboot Patterns6.1K
- Context Budget6.1K
- Accessibility6.1K
- Nestjs Patterns6.1K
- Seo6.1K
- Django Security6.1K
- Git Workflow6K
- Python Testing6K
- Strategic Compact6K
- Design System6K
- Browser Qa6K
- Springboot Security6K
- Search First6K
- Nextjs Turbopack6K
- Brand Voice6K
- Jira Integration6K
- Laravel Tdd6K
- Fastapi Patterns6K
- Remotion Video Creation6K
- React Patterns5.9K
- Perl Security5.9K
- Kotlin Coroutines Flows5.9K
- React Performance5.9K