Back to Skills

laravel-actions

Action-oriented architecture for Laravel. Invokable classes that contain domain logic. Use when working with business logic, domain operations, or when user mentions actions, invokable classes, or needs to organize domain logic outside controllers.

26stars7forksUpdated 3/3/2026

Security Assessment

Safe(100/100)
Security Score100/100

About laravel-actions

The 'laravel-actions' skill introduces an action-oriented architecture for Laravel applications. It focuses on encapsulating business logic into invokable classes, ensuring that controllers, jobs, and listeners remain free from domain logic. By following this approach, developers can streamline their Laravel applications by moving complex business operations out of controllers and into reusable actions. This provides a clear structure for handling domain operations, which can be invoked as standalone units of work. Whether it’s creating orders, managing users, or executing other domain-specific tasks, 'laravel-actions' offers a robust framework for handling those responsibilities efficiently and with clarity.

Key features of the 'laravel-actions' skill include invokable classes with a single `__invoke()` method, strict parameter and return types, and support for transactions that wrap database modifications. The skill emphasizes composing actions through dependency injection, allowing developers to build workflows that are both modular and reusable. Additionally, it provides a guard method pattern for validating business rules before actions are executed, as well as private helper methods to organize complex logic into smaller, manageable pieces. This promotes a clean, maintainable codebase that adheres to single responsibility principles and makes testing easier.

The 'laravel-actions' skill is ideal for Laravel developers who want to improve the organization and maintainability of their applications, especially when dealing with complex domain logic. It is particularly useful for applications with intricate business rules, as it promotes a clear separation of concerns between controllers and domain operations. Developers working on projects that require scalability and ease of testing will benefit from integrating this pattern into their workflows, as it encourages reusability and modularity in application logic.

FAQ

How do I use 'laravel-actions' in my Laravel application?

To use 'laravel-actions', you can create invokable action classes that encapsulate domain logic. These actions are invoked by passing the necessary parameters, often using dependency injection for composing complex workflows. Actions can be wrapped in database transactions for atomic operations.

Can I compose actions with other actions in 'laravel-actions'?

Yes, 'laravel-actions' supports action composition through dependency injection. You can inject other actions into a primary action class and call them as needed to build complex workflows.

Are there any compatibility requirements for using 'laravel-actions'?

'laravel-actions' is designed to work with Laravel and requires an understanding of the Laravel framework's concepts, such as controllers, models, and database transactions. There are no specific version requirements, but it is assumed you are using a modern version of Laravel.

Does 'laravel-actions' support transactional database operations?

Yes, 'laravel-actions' supports wrapping database modifications in transactions. This ensures that the business logic is executed atomically, and if any step fails, the entire operation can be rolled back.

Can I validate business rules before executing actions in 'laravel-actions'?

Yes, 'laravel-actions' supports guard methods for validation. You can define custom logic to validate business rules before performing actions, throwing exceptions when conditions are not met.

Install laravel-actions

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill