laravel-patterns

Standardize Laravel architecture with separation of concerns between controllers, services, and domain models.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/ThejanaJayalath/Niolla-PM-system --skill laravel-patterns-thejanajayalath
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-patterns
Source: https://github.com/ThejanaJayalath/Niolla-PM-system/tree/main/.cursor/skills/laravel-patterns
Command: npx skills add https://github.com/ThejanaJayalath/Niolla-PM-system --skill laravel-patterns-thejanajayalath

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the challenge of maintaining consistent, scalable, and clean architecture in Laravel applications by enforcing separation of concerns and standardized design patterns.

Core Features & Use Cases

  • Architectural Standardization: Implements a clear boundary between HTTP controllers, service layers, and domain models.
  • Production-Grade Patterns: Provides guidance on using scoped route-model binding, custom Eloquent casts, and efficient eager loading to prevent N+1 issues.
  • Use Case: When building a complex multi-tenant API, use these patterns to structure your service providers, form requests, and API resources to ensure the codebase remains maintainable as the project grows.

Quick Start

Use the laravel-patterns skill to generate a new service class and corresponding action for handling order processing.

Frequently Asked Questions about laravel-patterns

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

FAQPage Schema
How do I standardize Laravel architecture and enforce separation of concerns?

To standardize Laravel architecture, you enforce clear boundaries between HTTP controllers, service layers, and domain models. This approach maintains consistent dependency injection and validation logic across complex web and API-driven projects.

What is the best way to prevent Eloquent N+1 query issues in Laravel?

The best way to prevent Eloquent N+1 issues is by applying efficient eager loading. Implementing custom Eloquent query objects and casts standardizes data retrieval, keeping complex API resource management optimized and maintainable.

How do I implement scoped route-model binding for a multi-tenant Laravel API?

Scoped route-model binding for a multi-tenant Laravel API is implemented by structuring service providers and form requests to automatically constrain queries. This ensures domain models only access authorized tenant data during API requests.

Can I use Laravel service classes to handle complex order processing actions?

Yes, you can use Laravel service classes to handle complex order processing actions. By generating dedicated service classes and corresponding actions, you isolate business logic from controllers, maintaining clean architecture as the project grows.

Does separating controllers and domain models work for both web and API projects?

Separating controllers and domain models works for both web and API projects. Standardized design patterns ensure consistent dependency injection and API resource management, keeping complex multi-tenant applications maintainable.