Introduction
Traditional Laravel code tutorials often showcase controllers performing everything: authorization, validation, database transactions, email notifications, and view rendering. While fine for tiny apps, this pattern breaks down at scale.
Why Domain Actions?
- Single Responsibility: Each action class does exactly one task.
- Reusability: Call the same action from a controller, an Artisan command, or a queue job without duplicating logic.
- Painless Testing: Unit testing an action requires minimal setup and no HTTP mock plumbing.