actions

Encapsulate a single business operation into a Laravel Action class with an execute() method.

3|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/codebar-ag/coding-guidelines --skill actions-codebar-ag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: actions
Source: https://github.com/codebar-ag/coding-guidelines/tree/main/resources/boost/skills/actions
Command: npx skills add https://github.com/codebar-ag/coding-guidelines --skill actions-codebar-ag

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Actions solve the problem of scattered business logic by encapsulating one well-defined operation in a single class.

Core Features & Use Cases

  • Single-purpose operation per class with a dedicated execute() method.
  • Clear, testable orchestration invoked from controllers, commands, or jobs.
  • Smooth integration with Laravel's service container and dependency injection, with consistent naming and reusability. For a real-world scenario, an action like CreateInvoice could be invoked by a controller to generate an invoice and trigger related notifications.

Quick Start

Create an action class (e.g., CreateInvoice) with an execute() method and wire it into a controller or command to run the operation.

Frequently Asked Questions about actions

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

FAQPage Schema
How do I centralize scattered Laravel business logic into a single testable class?

Encapsulate Laravel business logic into an Action class to centralize operations. This provides a single-purpose class with a dedicated execute method, ensuring predictable orchestration invoked from controllers, commands, or jobs.

What is the best way to structure a single business operation in a Laravel backend?

The best way to structure a single business operation is using an Action class. It enforces a public execute method, utilizes constructor-based dependency injection, and relies on container-based resolution for consistent naming and reusability.

How do I invoke a single business operation from Laravel controllers, commands, or jobs?

You invoke a business operation by wiring an Action class into your Laravel controller, command, or job. Call its public execute method to run the operation with clear inputs and predictable outcomes.

Can I use Laravel service container dependency injection with Action classes?

Yes, Action classes integrate smoothly with the Laravel service container. They use constructor-based dependency injection and container-based resolution to ensure consistent orchestration and testability across your backend operations.

When should I use an Action class instead of standard controller methods in Laravel?

Use an Action class when controllers, commands, or jobs need a predictable, testable operation with clear inputs and outcomes. It solves the problem of scattered business logic by enforcing a single-responsibility operation per class.

Does an Action class require a specific method name to execute business logic in Laravel?

Yes, an Action class requires a public execute method to run the business logic. This enforces a single-purpose operation per class and provides clear orchestration for tasks like generating invoices and triggering notifications.