laravel-patterns

Organize Laravel architecture patterns for scalable web apps and APIs.

2|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/Throokie/claude-code-skills --skill laravel-patterns-throokie
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-patterns
Source: https://github.com/Throokie/claude-code-skills/tree/main/skills/laravel-patterns
Command: npx skills add https://github.com/Throokie/claude-code-skills --skill laravel-patterns-throokie

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel development often struggles with inconsistent architecture as apps grow. This guide provides production-grade patterns to organize controllers, services, domain logic, stores, and APIs for maintainable, scalable Laravel projects.

Core Features & Use Cases

  • Clear layer boundaries between HTTP controllers, services, and domain logic.
  • Structured project layout with Controllers, Services, Actions, Repositories, Jobs, and Resources.
  • Guidance for routing, Eloquent models, queues, events, caching, migrations, and API resources.
  • Use Case: Build a scalable API for a SaaS app with multi-tenant routing, proper validation, and consistent responses.

Quick Start

Create a new Laravel project and start implementing the recommended architecture layout.

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 for scalability and maintainability?

Structure a Laravel application by enforcing clear layer boundaries between HTTP controllers, services, domain logic, and repositories. This separation isolates business logic from routing and Eloquent models, ensuring a maintainable project layout as the codebase grows.

What is the best way to organize controllers, services, and domain logic in Laravel?

Organize controllers, services, and domain logic by adopting a structured project layout with dedicated directories for Actions, Jobs, and Resources. This pattern separates HTTP request handling from domain operations and Eloquent interactions to maintain consistent architecture.

Does this Laravel architecture pattern support multi-tenant SaaS API development?

Yes, this Laravel architecture pattern supports multi-tenant SaaS API development. It provides guidelines for multi-tenant routing, proper validation, and consistent API responses to build scalable web apps and APIs for real-world projects.

How do I manage queues, events, and caching in a layered Laravel architecture?

Manage queues, events, and caching in a layered Laravel architecture by encapsulating them within dedicated Services and Jobs. This approach keeps background processing and event-driven logic out of controllers, maintaining strict structural separation.

When should I use repositories instead of direct Eloquent models in Laravel?

Use repositories instead of direct Eloquent models in Laravel when you need to abstract complex data access logic away from services. Repositories provide a clean separation between domain logic and Eloquent ORM operations, keeping application layers maintainable.

How do I configure routing and API resources for a Laravel SaaS application?

Configure routing and API resources for a Laravel SaaS application by using explicit bindings and structured API Resources. This ensures typed models are handled correctly and consistent JSON responses are returned across the scalable API endpoints.