Laravel Controller Cleanup
Refactors bloated Laravel controllers into lean, maintainable structures using Form Requests, Actions, and DTOs.
The Laravel Controller Cleanup skill is designed to help developers adhere to the 'Skinny Controller' philosophy by automating the refactoring of complex backend logic. It guides the extraction of validation and authorization into Form Requests, moves business logic into reusable Action or Service classes, and implements Data Transfer Objects (DTOs) to decouple logic from the framework. This skill is essential for maintaining scalable Laravel applications, improving testability, and reducing technical debt in large-scale PHP projects.
Key Features
01Refactors complex business logic into standalone, reusable Action or Service classes.
02Converts monolithic controllers into Resource or Single-Action (invokable) controllers.
03Extracts validation and authorization logic into dedicated Form Request classes.
04Implements Data Transfer Objects (DTOs) to safely pass data between layers.
05137 GitHub stars
06Provides guidance for writing isolated unit tests for Actions and feature tests for routes.
Use Cases
01Decoupling business logic from the HTTP layer to enable multi-interface support (Web, CLI, API).
02Refactoring legacy 'God Controllers' into modular, testable components.
03Standardizing request validation and authorization patterns across a Laravel API.