Put business logic in a focused Action class or domain/service layer, not in the controller. The controller should receive a validated request, call one use case, and translate its result into an HTTP response. For example, `CreateOrder::handle(CreateOrderData $data)` can enforce order rules and coordinate repositories. The controller injects that Action and passes `$request->validated()` or a typed DTO. If the use case needs persistence abstraction, inject a repository interface and bind its...
Scanned 9/5/2026
Install to Claude Code
npx -y skills add HoangNguyen0403/agent-skills-standard --skill laravel-architecture --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Laravel Architecture?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-laravel-architecture-c159002a)More formats (shields.io, HTML) on the badges page.
Put business logic in a focused Action class or domain/service layer, not in the controller. The controller should receive a validated request, call one use case, and translate its result into an HTTP response.
For example, `CreateOrder::handle(CreateOrderData $data)` can enforce order rules and coordinate repositories. The controller injects that Action and passes `$request->validated()` or a typed DTO. If the use case needs persistence abstraction, inject a repository interface and bind its Eloquent implementation in `AppServiceProvider`.
This keeps controllers free of Eloquent queries, branching business rules, and manual dependency construction. Split large services by use case rather than creating a God Service. Use Form Requests for authorization and validation, and API Resources or views for representation.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!