laravel-enterprise

Creates Laravel APIs using repository interfaces, service layers, DTOs, FormRequests, and API Resources.

5|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/iamBrzDev/enterprise-agent-skills --skill laravel-enterprise
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-enterprise
Source: https://github.com/iamBrzDev/enterprise-agent-skills/tree/main/skills/laravel-enterprise
Command: npx skills add https://github.com/iamBrzDev/enterprise-agent-skills --skill laravel-enterprise

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Many Laravel projects grow with fat controllers, inconsistent validation, and ad-hoc data access that make teamwork, testing, and maintenance difficult; this Skill prescribes a clear layered architecture to avoid those pitfalls and enable predictable, team-scale development.

Core Features & Use Cases

  • Layered Architecture: Enforces Request → FormRequest → Controller → Service → Repository → Eloquent to keep controllers thin and responsibilities separated.
  • Enterprise Patterns: Promotes Repository interfaces with bindings, service layer orchestration with transactions and side effects, DTOs between layers, API Resources for consistent responses, and centralized exception handling.
  • Use Case: Ideal when building or refactoring an Orders API for a multi-developer backend where validation, transactional integrity, and predictable response shaping are required.

Quick Start

Create a new Laravel module for orders using repository interfaces, a service layer with transactions, FormRequests for validation, DTOs between layers, and API Resources for responses.

Frequently Asked Questions about laravel-enterprise

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

FAQPage Schema
How do I structure a Laravel API with repository pattern and service layers?

To structure a Laravel API with repository pattern and service layers, route requests through FormRequest validation into thin controllers, which delegate to services handling transactions and side effects, then use repository interfaces for data access and API Resources for responses.

Why should I use DTOs between layers in a Laravel backend project?

DTOs between layers in a Laravel backend project ensure predictable data transfer by separating typed objects from Eloquent models. This keeps service orchestration clean, prevents accidental mass assignment, and enforces a strict boundary between business and data layers.

What is the best way to refactor fat controllers in a multi-developer Laravel project?

The best way to refactor fat controllers in a multi-developer Laravel project is to extract validation into FormRequests, move business logic into transactional service classes, bind repository interfaces in the container, and shape responses using API Resources.

Does this Laravel service layer approach support queued side effects and transactions?

Yes, this Laravel service layer approach supports queued side effects and transactions. Services orchestrate transactional business logic and dispatch queued jobs after successful operations, while centralized exception handling ensures failures roll back without corrupting data.

How do FormRequests and API Resources work together in a layered Laravel architecture?

FormRequests and API Resources work together in a layered Laravel architecture by separating input validation from output formatting. FormRequests authorize and validate incoming data before it reaches the controller, while API Resources transform Eloquent models into consistent JSON responses.

When should I not use repository interfaces in a Laravel API?

Repository interfaces in a Laravel API add abstraction that benefits team-scale development and complex transactional logic, but they introduce unnecessary overhead for simple CRUD operations or solo projects where direct Eloquent access within controllers is sufficient.