0026-laravel-controller-cleanup
CommunityKeep Laravel controllers lean and focused
Software Engineering#laravel#services#actions#form requests#controller refactor#data transfer objects#resource controllers
AuthorMrJmpl3
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Laravel controllers can grow bloated when they handle authorization, validation, and business logic in one place, making routes harder to maintain and test.
Core Features & Use Cases
- Move auth/validation into Form Requests: Centralize authorization and validation rules in dedicated Request classes so controller methods stay orchestration-only.
- Extract business logic to Actions/Services with DTOs: Encapsulate one responsibility per Action or a larger workflow per Service, passing DTOs to avoid leaking framework concerns.
- Prefer resource or single-action controllers: Use resource controllers for standard CRUD and invokable controllers for single-purpose endpoints.
Quick Start
Ask an AI to refactor the target controller by extracting validation into a Form Request, moving the core logic into an Action/Service that receives a DTO, and converting the controller to the appropriate resource or invokable style.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: 0026-laravel-controller-cleanup Download link: https://github.com/MrJmpl3/codex_____data_____configuration/archive/main.zip#0026-laravel-controller-cleanup Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.