What problem does it solve?
This Skill helps Laravel projects shed fat controllers, duplicated logic, and inconsistent patterns by applying modern PHP 8.3+/8.4+ features and Laravel 11+ best practices. It enables teams to produce clean, maintainable code with clear responsibilities, strong typing, and modular architecture.
Core Features & Use Cases
- Extract business logic from controllers into single-purpose actions or services to follow the Single Responsibility Principle.
- Introduce modern PHP features (typed constants, property hooks) and Laravel 11+ patterns (Actions, simplified structure) to reduce boilerplate.
- Identify and address common anti-patterns (fat controllers, N+1 queries, missing type declarations) and retrofit with clean architecture.
- Use cases: refactor a legacy controller into a thin controller + actions/services, or gradually migrate to domain-driven structure with tests.
Quick Start
Start by locating a fatty controller (e.g., app/Http/Controllers/AuthController), create a dedicated Action or Service, inject it into the controller, and progressively move logic with type declarations. Then run your Pest/PHPUnit tests to ensure behavior remains unchanged.