laravel-actions
Installation
SKILL.md
Laravel Actions or lorisleiva/laravel-actions
Overview
Use this skill to implement or update actions based on lorisleiva/laravel-actions with consistent structure and predictable testing patterns.
Quick Workflow
- Confirm the package is installed with
composer show lorisleiva/laravel-actions. - Create or edit an action class that uses
Lorisleiva\Actions\Concerns\AsAction. - Implement
handle(...)with the core business logic first. - Add adapter methods only when needed for the requested entrypoint:
asController(+ route/invokable controller usage)asJob(+ dispatch)asListener(+ event listener wiring)asCommand(+ command signature/description)
- Add or update tests for the chosen entrypoint.
- When tests need isolation, use action fakes (
MyAction::fake()) and assertions (MyAction::assertDispatched()).