laravel-patterns

Enforce architectural layer boundaries across Laravel routing, controllers, services, and models.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/cescrafli/compyrasion --skill laravel-patterns-cescrafli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-patterns
Source: https://github.com/cescrafli/compyrasion/tree/main/skills/laravel-patterns
Command: npx skills add https://github.com/cescrafli/compyrasion --skill laravel-patterns-cescrafli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel projects often become tangled as controllers, services, and domain logic grow, making maintenance difficult. This skill provides a clear architectural blueprint to separate concerns and standardize data flow across routing, controllers, services, and Eloquent models to support production-grade apps.

Core Features & Use Cases

  • Clear layer boundaries: HTTP routes/controllers, service actions, and models to keep responsibilities separate.
  • Eloquent patterns, repositories, and service layers for predictable data access and testability.
  • Queues, events, caching, and API resources to improve scalability, responsiveness, and reliability.
  • Use Case: Build scalable web apps or APIs with maintainable patterns that evolve with business requirements.

Quick Start

Apply the Laravel pattern blueprint to scaffold a project with clean layers and reusable components.

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 application with clear boundaries between controllers and services?

To structure Laravel applications with clear boundaries, separate HTTP routes and controllers from service actions and Eloquent models. This architecture keeps responsibilities distinct, standardizes data flow, and improves maintainability across production-grade projects.

What is the best way to organize Eloquent models and service layers in Laravel for testability?

Organizing Eloquent models and service layers in Laravel involves using repositories and service actions for data access. This pattern ensures predictable data flow, explicit layer boundaries, and robust testability for complex web apps.

How do I scale Laravel apps using queues, events, and caching patterns?

Scale Laravel apps by implementing queues, events, and caching patterns alongside API resources. This architecture improves responsiveness and reliability by standardizing data flow and enforcing explicit service wiring across asynchronous operations.

Do I need explicit service bindings to enforce architectural patterns in Laravel?

Yes, enforcing architectural patterns in Laravel requires explicit service bindings and centralized configuration. This setup ensures predictable behavior, clear layer boundaries, and robust data flow across controllers, events, and queues.

When should I use architectural patterns for my Laravel project?

Use architectural patterns for Laravel projects when controllers, services, and domain logic grow tangled. This approach provides a blueprint to separate concerns, standardize data flow, and support maintainable production apps.

Why does my Laravel codebase become hard to maintain as controllers and domain logic grow?

Laravel codebases become hard to maintain when controllers, services, and domain logic mix without clear layer boundaries. Applying architectural patterns separates concerns and standardizes data flow to support scalability.