laravel-patterns

Define Laravel architectural patterns for controllers, services, repositories, and API resources.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill laravel-patterns-sakamoto-family-smile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-patterns
Source: https://github.com/sakamoto-family-smile/agent_monorepo/tree/main/.claude/skills/ecc/laravel-patterns
Command: npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill laravel-patterns-sakamoto-family-smile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel projects often suffer from tangled controllers, scattered business logic, and inconsistent data access patterns, making maintenance and scaling difficult. This Skill provides a clear, production-grade architecture blueprint for Laravel apps.

Core Features & Use Cases

  • Clear layering: HTTP controllers, services, repositories, and models to separate concerns.
  • Eloquent-guided domain logic: patterns for models, relationships, and data access.
  • API-first design: resources, pagination, routing, and versioning strategies for scalable APIs.
  • Queues, events, and caching: guidance on asynchronous work and performance optimization.
  • Practical project structure: a recommended directory layout and code organization examples.

Quick Start

Create a Laravel module using the recommended layout with Controllers, Services, Repositories, Models, and API Resources to demonstrate the patterns.

Frequently Asked Questions about laravel-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Laravel app to prevent fat controllers and scattered business logic?

To structure a scalable Laravel application, separate concerns using HTTP controllers for routing, services for business logic, repositories for data access, and models for domain logic to prevent tangled controllers.

What is the best way to organize Eloquent models and data access patterns in a production Laravel project?

The best way to organize Eloquent data access is using repository patterns alongside Eloquent-guided domain logic. This approach centralizes query logic, keeping models focused on relationships and domain rules while maintaining a clean API surface.

How do I design API resources and routing for scalable Laravel APIs?

Design scalable Laravel APIs by applying API-first patterns using API resources, pagination, and routing versioning strategies. This structures data transformation and endpoint management to handle growth without breaking existing client integrations.

Can I use service layers and queues together to handle asynchronous work in Laravel?

Yes, you can integrate service layers with queues and events to handle asynchronous work in Laravel. Offloading heavy processes to queues within your service layer optimizes application performance and keeps HTTP responses fast.

Does this Laravel architecture pattern require a specific project directory layout?

This Laravel architecture pattern provides a recommended directory layout rather than enforcing a rigid structure. It offers a practical project organization with example code patterns for controllers, services, repositories, models, and API resources.