Download the PHP package aesircloud/laravel-actions without Composer
On this page you can find all versions of the php package aesircloud/laravel-actions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aesircloud/laravel-actions
More information about aesircloud/laravel-actions
Files in aesircloud/laravel-actions
Package laravel-actions
Short Description A simple Actions package for Laravel with job/queue/controller support.
License MIT
Homepage https://github.com/AesirCloud/laravel-actions
Informations about the package laravel-actions
READ ME
A simple actions package for Laravel.
Features
- Single-Class Workflow: Write your logic once in a single
Action
class. No need to duplicate code in controllers, jobs, or other classes. - Run Synchronously or as a Queued Job
- Call
MyAction::run($data)
for immediate, synchronous execution. - Call
MyAction::dispatch($data)
to run the action as a queued job.
- Call
- Controller Integration
- Use your
Action
as an invokable controller with __invoke(). - Or define multiple methods (e.g., index, store) and treat it like a standard Laravel controller.
- Override
asController()
to parse/validate request data before callinghandle()
.
- Use your
Installation
You can install the package via composer:
Laravel’s package auto-discovery will register the service provider automatically. If you need to manually register it, add the following to your config/app.php
providers array:
PUBLISHING STUBS
To customize the stub files used for scaffolding, publish the package stubs:
Usage
To scaffold a new action, run the following command:
This will create a new action class in the app/Actions
directory.
Basic Example
Creates an action file under app/Actions/CreateUser.php
.
Running Synchronously
You can run the action synchronously by calling the run
method on the action class:
Running as a Job
You can run the action as a job by calling the dispatch
method on the action class:
Running as an Invokable Controller
Running as a Multi-Method Controller
Security
If you've found a bug regarding security please mail [email protected] instead of using the issue tracker.
LICENSE
The MIT License (MIT). Please see License file for more information.
All versions of laravel-actions with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/console Version ^11.0|^12.0
laravel/framework Version ^11.0|^12.0