Skip to content
affaan-m avatar

Laravel Patterns

Laravel architecture patterns for controllers, Eloquent, services, queues, and API resources in production apps.

CCM score
71 of 100
skills.sh installs
13.8K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers controller-to-service layering, Eloquent models and scopes, route binding, and migration naming conventions
  • Includes Recommended Layout directory map plus code samples for actions, route model binding, scoped bindings, and casts
  • Enforces scoped bindings for nested routes to prevent cross-tenant access, and eager loading to avoid N+1 queries
  • Designed for developers building or reviewing Laravel web apps and APIs that need predictable, maintainable structure

Install

$ npx -y skills add affaan-m/ecc --skill laravel-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/affaan-m/ecc
Categories
PHP & Laravel, Backend & APIs
First seen
Jul 14, 2026

Questions

What does the laravel-patterns skill help with?

The laravel-patterns skill covers Laravel architecture patterns, including routing and controllers, Eloquent ORM, service layers, queues, events, caching, and API resources for production apps. It is meant for building or reviewing Laravel applications, controllers, Eloquent models, service layers, queues, or API resources.

How do I install the laravel-patterns skill?

Run npx -y skills add affaan-m/ecc --skill laravel-patterns -y inside your project to install it. Once installed, the agent can structure controllers, services and actions, scoped route bindings, and Eloquent patterns such as eager loading and query scopes.

Where does laravel-patterns rank among PHP and Laravel skills?

On the PHP and Laravel category page, laravel-patterns ranks in the top three. Other skills in that category include laravel-specialist, php-pro, laravel-verification, laravel-plugin-discovery and wordpress-pro.

Does laravel-patterns handle multi-tenant access control?

It shows scoped route bindings, which prevent a nested resource from being reached through the wrong parent, such as a project under a different account. The skill also says authorization must still be enforced separately for access control.

More from affaan-m/ecc

All 257

Similar to Laravel Patterns

More PHP & Laravel