controllers

Enforce thin Laravel controllers that validate input and delegate to Actions or Services.

3|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/codebar-ag/coding-guidelines --skill controllers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: controllers
Source: https://github.com/codebar-ag/coding-guidelines/tree/main/resources/boost/skills/controllers
Command: npx skills add https://github.com/codebar-ag/coding-guidelines --skill controllers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Thin HTTP controllers that validate input and delegate to Actions or Services, avoiding business logic in controllers.

Core Features & Use Cases

  • Delegation: Controllers delegate to dedicated Actions or Services.
  • Validation separation: Use FormRequest for all input validation.
  • Consistent responses: Return appropriate HTTP responses (JSON or views) after delegation.

Quick Start

Refactor a bloated controller into a thin controller that validates input with a FormRequest and delegates to an Action.

Frequently Asked Questions about controllers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep my Laravel controllers thin and free of business logic?

You can keep controllers thin by using FormRequest for input validation and delegating all business logic to dedicated Action or Service classes, ensuring controllers only handle HTTP delegation.

What is the best way to handle input validation in Laravel API controllers?

The best way to handle input validation in Laravel API controllers is using FormRequest classes, which separates validation rules from controllers and ensures data integrity before delegation.

How do I structure single-action endpoints in a Laravel web application?

Single-action endpoints in Laravel should be structured using invokable controllers, allowing each endpoint to handle one specific HTTP request and delegate execution to Actions or Services.

Does this thin controller approach work with both Laravel API projects and web routes?

Yes, this thin controller approach applies to both Laravel API projects and web routes, requiring FormRequest validation and proper authorization patterns to return JSON or views after delegation.

Why should I refactor a bloated controller into an invokable controller with FormRequest?

You should refactor a bloated controller into an invokable controller with FormRequest to separate validation and business logic, preventing code duplication and making your HTTP delegation layer maintainable.