Back to Skills

laravel-patterns

Laravel architecture patterns, routing/controllers, Eloquent ORM, service layers, queues, events, caching, and API resources for production apps.

176,164stars27,258forksUpdated 5/9/2026

Security Assessment

Safe(90/100)

Detected risks:

Sensitive File Access([SKILL.md] .env)
Security Score90/100

About laravel-patterns

The laravel-patterns skill provides developers with structured guidance for building scalable, maintainable, and production-ready Laravel applications. It focuses on enforcing clear architectural boundaries, including controllers, services, actions, and models, to ensure a clean separation of concerns. By following these patterns, developers can avoid common pitfalls in Laravel applications, such as bloated controllers, inconsistent domain logic, or inefficient handling of IO-heavy operations. The skill emphasizes best practices for route management, model binding, authorization, and configuration centralization, making Laravel projects easier to maintain and extend over time.

This skill covers key aspects of Laravel development, including routing and controllers, Eloquent ORM usage, service layers, queues, events, caching, and API resource handling. It guides developers to keep controllers thin, delegate orchestration to services, and encapsulate single-purpose logic in actions. It also provides conventions for project structure, form request validation, scoped route model binding to prevent unauthorized access, and resource-based API design. By using typed models, casts, and scopes, developers can maintain consistent domain logic, while queues and caching help optimize performance for IO-intensive tasks.

Typical use cases for laravel-patterns include building web applications, RESTful APIs, and applications requiring background job processing or complex domain logic. It is aimed at Laravel developers who want to enforce best practices for architecture, improve maintainability, and design APIs efficiently. Teams working on medium to large-scale projects can benefit from these patterns to standardize coding practices, enhance collaboration, and reduce technical debt across their Laravel applications.

FAQ

How should I structure a Laravel project using this skill?

Follow the recommended layout with clear boundaries: controllers in Http/Controllers, services in Services/, single-purpose actions in Actions/, and models in Models/. Organize routes in routes/api.php or routes/web.php as appropriate.

Can this skill be used for both web applications and APIs?

Yes, the skill is suitable for building both Laravel web applications and RESTful APIs, with guidance on routing, controllers, API resources, and pagination.

Does it require any specific Laravel version?

The skill assumes standard Laravel architecture patterns but does not specify a minimum version. It is compatible with production-grade Laravel applications that support resource controllers, route model binding, and Eloquent ORM features.

How does it handle background jobs and performance?

The skill recommends using queues for IO-heavy work and caching expensive reads to optimize performance and maintain responsiveness in production applications.

Are there any limitations in terms of multi-tenant applications?

Scoped route model bindings are recommended to prevent cross-tenant access, but developers must enforce additional authorization checks as needed for complex multi-tenant scenarios.

Install laravel-patterns

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill