skills/smithery.ai/service-provider-architecture

service-provider-architecture

Installation
SKILL.md

Service Provider Architecture Skill

A comprehensive guide for structuring Laravel applications using the Service Provider pattern. Each domain entity is organized into a consistent set of artifacts — Model, DTO, Service, Controller, FormRequest, Resource, Policy, Event, Listener, and ServiceProvider — ensuring separation of concerns, testability, and maintainability.

Target users: Full-stack Laravel + React (Inertia.js) developers who want clean, domain-organized code with predictable patterns.

Core Principles

  1. Thin controllers — Controllers only receive requests, delegate to services, and return responses
  2. Fat services — All business logic lives in service classes, never in controllers or models
  3. Immutable DTOs — Data moves between layers via typed, readonly data transfer objects
  4. Smart models — Models define relationships, scopes, casts, and accessors, but no business logic
  5. Explicit authorization — Every action is authorized via policies, never inline in controllers
  6. Side effects via events — Notifications, logging, webhooks are decoupled through events/listeners

Layer Architecture

Installs
1
First Seen
Apr 9, 2026