Keep controllers thin and make them coordinate HTTP concerns only: 1. Put input rules in a Form Request with `authorize()` and `rules()`. 2. Inject a single-responsibility Action through the constructor or method signature. 3. Pass `$request->validated()` to the Action. 4. Return a resource or view from the Action result and map HTTP status codes at the controller boundary. ```php public function store(StoreUserRequest $request, CreateUser $create): UserResource { return new UserResource($cre...
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-agent-skills-standard)More formats (shields.io, HTML) on the badges page.
Keep controllers thin and make them coordinate HTTP concerns only:
1. Put input rules in a Form Request with `authorize()` and `rules()`.
2. Inject a single-responsibility Action through the constructor or method signature.
3. Pass `$request->validated()` to the Action.
4. Return a resource or view from the Action result and map HTTP status codes at the controller boundary.
```php
public function store(StoreUserRequest $request, CreateUser $create): UserResource
{
return new UserResource($create->handle($request->validated()));
}
```
Keep Eloquent queries and business decisions out of the controller. Bind interfaces to swappable implementations in `AppServiceProvider`, and use dependency injection rather than `new` inside actions or controllers. This structure keeps validation, use-case logic, and HTTP serialization independently testable.
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!