laravel-patterns

Standardizes Laravel app architecture by separating HTTP layers, services, and Eloquent models.

1|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/vrcms/everything-qwen-code --skill laravel-patterns-vrcms
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-patterns
Source: https://github.com/vrcms/everything-qwen-code/tree/main/.qwen/skills/laravel-patterns
Command: npx skills add https://github.com/vrcms/everything-qwen-code --skill laravel-patterns-vrcms

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the challenge of maintaining clean, scalable, and predictable codebases in Laravel by enforcing architectural boundaries and standardized design patterns.

Core Features & Use Cases

  • Layered Architecture: Implements a clear separation between Controllers, Services, Actions, and Models to prevent bloated code.
  • Domain Logic Encapsulation: Provides patterns for Eloquent model configuration, custom casts, and reusable query scopes.
  • API Consistency: Standardizes API responses using resources and pagination, ensuring predictable integration for frontend consumers.

Quick Start

Use the laravel-patterns skill to refactor my current controller into a service-action pattern for better maintainability.

Frequently Asked Questions about laravel-patterns

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

FAQPage Schema
How do I separate concerns between controllers, services, and Eloquent models in Laravel?

Standardize Laravel application architecture by enforcing strict separation between HTTP layers, service classes, and Eloquent models. This layered architecture prevents bloated controllers and ensures clean, scalable codebases.

What is the best way to refactor a Laravel controller into a service-action pattern?

Refactor a Laravel controller by extracting business logic into dedicated service classes and action objects. This pattern maintains a clean separation of concerns, keeping HTTP layers focused on request handling while services manage domain logic.

How do I standardize API resource responses and pagination in Laravel?

Standardize API resource responses in Laravel by implementing consistent API resource management and pagination patterns. This ensures predictable data formatting and reliable integration for frontend consumers.

How do I implement efficient database query patterns and scoped model bindings in Laravel?

Implement efficient database query patterns and scoped model bindings in Laravel by configuring Eloquent models with custom casts and reusable query scopes. This approach encapsulates domain logic and optimizes production database queries.

Do I need specific dependencies to use dependency injection through service providers in Laravel?

No specific dependencies are required to use dependency injection through service providers in Laravel. The framework natively supports injecting services into your classes to ensure consistent application architecture and domain logic encapsulation.