> laravel-controller-cleanup
Reduce controller bloat using Form Requests for auth/validation, small Actions/Services with DTOs, and resource/single-action controllers
fetch
$
curl "https://skillshub.wtf/noartem/skills/laravel-controller-cleanup?format=md"SKILL.md•laravel-controller-cleanup
Controller Cleanup
Keep controllers small and focused on orchestration.
Move auth/validation to Form Requests
- Create a Request class (e.g.,
StoreUserRequest) and useauthorize()+rules() - Type-hint the Request in your controller method; Laravel runs it before the action
php artisan make:request StoreUserRequest
Extract business logic to Actions/Services
- Create a small Action (one thing well) or a Service for larger workflows
- Pass a DTO from the Request to the Action to avoid leaking framework concerns
final class CreateUserAction {
public function __invoke(CreateUserDTO $dto): User { /* ... */ }
}
Prefer Resource or Single-Action Controllers
- Use resource controllers for standard CRUD
- For one-off endpoints, use invokable (single-action) controllers
Testing
- Write feature tests for the controller route
- Unit test Actions/Services independently with DTOs
> related_skills --same-repo
> vue3-component-decomposition
Decompose large Vue 3 components into focused SFCs and composables with explicit contracts, simple templates, and SSR-safe side effects.
> shadcn-vue
shadcn-vue for Vue/Nuxt with Reka UI components and Tailwind. Use for accessible UI, Auto Form, data tables, charts, dark mode, MCP server setup, or encountering component imports, Reka UI errors.
> laravel-transactions-and-consistency
Wrap multi-write operations in transactions; use dispatchAfterCommit and idempotency patterns to ensure consistency
> laravel-template-method-and-plugins
Stabilize workflows with Template Method or Strategy; extend by adding new classes instead of editing core logic
┌ stats
installs/wk0
░░░░░░░░░░first seenMar 17, 2026
└────────────