laravel-patterns

Organize Laravel applications with design patterns, route conventions, and service layers.

3|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/rlagycks/oh-my-forge --skill laravel-patterns-rlagycks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-patterns
Source: https://github.com/rlagycks/oh-my-forge/tree/main/skills/laravel-patterns
Command: npx skills add https://github.com/rlagycks/oh-my-forge --skill laravel-patterns-rlagycks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers often struggle with structuring Laravel applications for maintainability and scalability, leading to confusion and inefficient workflows.

Core Features & Use Cases

  • Structured project layouts: Provides clear directory conventions for organizing controllers, services, models, and resources.
  • Design patterns: Demonstrates controller-service-action separation, route model binding, and dependency injection for reliable application behavior.
  • Use Case: Use this skill to improve an existing Laravel project by refactoring controllers and routes for better testability and readability.

Quick Start

Use the Laravel development patterns skill to implement best practices for project organization and route handling.

Frequently Asked Questions about laravel-patterns

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

FAQPage Schema
What is the best way to structure a scalable Laravel application architecture?

To structure a Laravel application for maintainability, implement controller-service-action separation, route model binding, and dependency injection. Clear directory conventions for controllers, services, models, and resources ensure reliable behavior and readable code.

How do I separate controllers and services in Laravel?

To separate controllers and services in Laravel, implement the controller-service-action pattern. Move business logic into dedicated service layer classes, use dependency injection to pass services into controllers, and configure route model binding to handle data retrieval automatically.

When do I need a service layer in Laravel MVC projects?

You need a service layer in Laravel MVC projects when controllers become bloated with business logic. Implementing controller-service separation isolates data handling from routing, improving testability and making the application architecture more maintainable and scalable.

How do I refactor Laravel routes and controllers for better testability?

Refactor Laravel routes and controllers for better testability by implementing route model binding, moving business actions into a service layer, and applying dependency injection. This separation isolates routing from logic, ensuring reliable application behavior and cleaner code.

Does using a service layer with route model binding fit large Laravel codebases?

Using a service layer with route model binding fits large Laravel codebases by enforcing strict separation of concerns. This architectural approach supports scalable development, keeping controllers thin and models properly configured using global scopes and dependency injection.