laravel-controllers
Laravel Controllers
Controllers are extremely thin. They handle HTTP concerns only and contain zero domain logic.
Related guides:
- query-objects.md - Query objects for API filtering/sorting
- Actions - Actions contain the domain logic
- form-requests.md - Validation layer
- DTOs - DTOs for data transfer
- structure.md - Web vs API organization
Philosophy
Controllers should ONLY:
- Type-hint dependencies
- Validate (via Form Requests)
- Call actions
- Return responses (resources, redirects, views)
More from leeovery/agentic-skills
laravel-quality
Code quality tooling with PHPStan, Pint, and strict types. Use when configuring or running static analysis, code style, or linting.
26laravel-testing
Comprehensive testing patterns with Pest. Use when writing or modifying tests, mocking, factories, or test patterns.
25laravel-query-builders
Custom query builders for type-safe, composable database queries. Use when creating or modifying query builders, query scopes, or complex database queries.
25laravel-architecture
High-level architecture decisions, patterns, and project structure. Use when deciding which pattern to use, organizing code, or making structural decisions.
23laravel-providers
Service providers, bootstrapping, and application configuration. Use when modifying service providers, booters, bootstrap logic, or app-level configuration.
23laravel-validation
Form request validation and comprehensive validation testing. Use when creating or modifying form requests, validation rules, or validation tests.
23