laravel-actions

Encapsulate Laravel domain logic in invokable Action classes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps Laravel developers move domain logic out of controllers by encapsulating business operations in invokable Action classes that form a cohesive, testable domain layer.

Core Features & Use Cases

  • Invokable Actions: single __invoke method with strict typing and transactions.
  • Composition: build complex workflows by injecting and invoking other actions.
  • Testability: easy unit testing of individual domain steps.
  • Clear organization: aligns code structure with domain boundaries (Actions by domain).

Quick Start

Define a simple Action class with an __invoke method, then call it from a controller or service using dependency injection or the resolve() helper.

Frequently Asked Questions about laravel-actions

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

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

To move domain logic out of Laravel controllers, encapsulate business operations in invokable Action classes with strict typing and transactions. This creates a testable domain layer and aligns code structure with clear domain boundaries.

What is the invokable action pattern in Laravel?

The invokable action pattern in Laravel uses classes with a single __invoke method to execute business operations. It enforces strict typing, dependency injection, and database transactions for reusable and composable workflows.

How do I structure complex Laravel workflows using actions?

Structure complex Laravel workflows by injecting and invoking other action classes within a parent action. This composition approach allows you to build reusable operations for processes like user onboarding or order processing while maintaining testability.

Can I unit test individual domain operations in Laravel actions?

Yes, you can unit test individual domain operations in Laravel actions because business logic is encapsulated in single invokable classes. This isolation makes testing specific domain steps easy without booting the entire application.

Do I need extra packages to use Laravel actions for domain logic?

No, you do not need extra packages to use Laravel actions for domain logic. You can define a simple Action class with an __invoke method and call it from a controller or service using native dependency injection or the resolve() helper.

When should I use Laravel actions instead of standard controllers?

Use Laravel actions instead of standard controllers when your application needs clear domain boundaries, reusable workflows, and composable operations. Actions prevent fat controllers by moving complex business logic like order processing into a dedicated domain layer.