laravel-controllers

Enforce thin Laravel controllers that delegate business logic to actions.

1|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/nextplus896/durra-alaseel --skill laravel-controllers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-controllers
Source: https://github.com/nextplus896/durra-alaseel/tree/main/.github/skills/claude-laravel/laravel-controllers
Command: npx skills add https://github.com/nextplus896/durra-alaseel --skill laravel-controllers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a strict boundary between the HTTP layer and domain logic by ensuring controllers remain thin and free of business rules, reducing coupling and improving testability.

Core Features & Use Cases

  • Thin HTTP layer: controllers handle HTTP concerns only and delegate domain logic to actions.
  • Clear separation: encourages a clean boundary between web/API layers and business logic.
  • Consistent RESTful patterns: guides on RESTful method usage, naming, and route integration.
  • Real-world scenarios: demonstrates how to refactor existing controllers to call Actions.

Quick Start

Create a Laravel controller that delegates all business logic to Actions and returns a Resource or Redirect.

Frequently Asked Questions about laravel-controllers

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

FAQPage Schema
How do I keep domain logic out of my Laravel controllers?

Yes, you can refactor existing Laravel controllers to call actions. Move all business rules into separate action classes, then update your controller methods to type-hint dependencies, invoke those actions, and return resources or redirects.

What is the best way to structure RESTful methods in Laravel API controllers?

Laravel thin controllers require type-hinting dependencies, validating requests via form requests, calling actions for domain logic, and returning appropriate HTTP responses. You must ensure no direct business rules exist within the controller's HTTP layer.

How does separating the HTTP layer from business logic improve Laravel testing?

Laravel thin controllers require type-hinting dependencies, validating requests via form requests, calling actions for domain logic, and returning appropriate HTTP responses. You must ensure no direct business rules exist within the controller's HTTP layer.

When should I use form requests in Laravel controllers?

Yes, you can refactor existing Laravel controllers to call actions. Move all business rules into separate action classes, then update your controller methods to type-hint dependencies, invoke those actions, and return resources or redirects.