PHPackages                             aesircloud/laravel-actions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. aesircloud/laravel-actions

ActiveLibrary[Queues &amp; Workers](/categories/queues)

aesircloud/laravel-actions
==========================

A simple Actions package for Laravel with job/queue/controller support.

1.1.1(8mo ago)0331MITPHPPHP ^8.4CI passing

Since Feb 28Pushed 8mo agoCompare

[ Source](https://github.com/AesirCloud/laravel-actions)[ Packagist](https://packagist.org/packages/aesircloud/laravel-actions)[ Docs](https://github.com/AesirCloud/laravel-actions)[ RSS](/packages/aesircloud-laravel-actions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (7)Used By (1)

READ ME
=======

[](#read-me)

---

A simple actions package for Laravel.

> **Requirements:** PHP 8.4+ and Laravel 12.

---

[![](https://camo.githubusercontent.com/669a905b64448fff4d375b7492371f9c59d5918687898e54b3433800d1a66ebe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6165736972636c6f75642f6c61726176656c2d616374696f6e732f746573742e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/aesircloud/laravel-actions/actions)[![](https://camo.githubusercontent.com/efc5bc2f49b23666a7bd005ea9b0ea96f28a1dbed61bbea5fc6d438020b53c74/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6165736972636c6f75642f6c61726176656c2d616374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aesircloud/laravel-actions)[![](https://camo.githubusercontent.com/9840ef45729d4d9756d53d6458d1aa3c1bc492adbebc8948e9a69d1b27d5dfc1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6165736972636c6f75642f6c61726176656c2d616374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aesircloud/laravel-actions)[![](https://camo.githubusercontent.com/5633db180fd0158acbbc73cf1170f12d2403a8383e774e22a6b1012046ede1dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6165736972636c6f75642f6c61726176656c2d616374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aesircloud/laravel-actions)

Features
--------

[](#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.
- **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 calling `handle()`.

Installation
------------

[](#installation)

You can install the package via composer:

```
  composer require aesircloud/laravel-actions
```

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:

```
AesirCloud\LaravelActions\Providers\ActionServiceProvider::class,
```

PUBLISHING STUBS
----------------

[](#publishing-stubs)

To customize the stub files used for scaffolding, publish the package stubs:

```
php artisan vendor:publish --tag=actions-stubs
```

Usage
-----

[](#usage)

To scaffold a new action, run the following command:

```
php artisan make:action {ActionName}
```

This will create a new action class in the `app/Actions` directory.

### Basic Example

[](#basic-example)

```
php artisan make:action CreateUser
```

Creates an action file under `app/Actions/CreateUser.php`.

```
namespace App\Actions;

use AesirCloud\LaravelActions\Action;

class CreateUser extends Action
{
    public function handle()
    {
        // Your logic here...
    }
}
```

Running Synchronously
---------------------

[](#running-synchronously)

You can run the action synchronously by calling the `run` method on the action class:

```
$user = CreateUser::run($data);
```

Running as a Job
----------------

[](#running-as-a-job)

You can run the action as a job by calling the `dispatch` method on the action class:

```
$pending = CreateUser::dispatch($data);
```

Running as an Invokable Controller
----------------------------------

[](#running-as-an-invokable-controller)

```
// app/Actions/MyAction.php
namespace App\Actions;

use AesirCloud\LaravelActions\Action;
use Illuminate\Http\Request;

class MyAction extends Action
{
    public function handle(): mixed
    {
        return 'Hello world!';
    }

    public function asController(Request $request): mixed
    {
        // e.g., $data = $request->validate([...]);
        return $this->handle();
    }
}
```

```
// routes/web.php
use App\Actions\MyAction;
use Illuminate\Support\Facades\Route;

Route::get('/my-action', MyAction::class);
```

Running as a Multi-Method Controller
------------------------------------

[](#running-as-a-multi-method-controller)

```
namespace App\Actions;

use AesirCloud\LaravelActions\Action;
use Illuminate\Http\Request;

class MyAction extends Action
{
    public function handle(): mixed
    {
        return 'Default logic (if you still want to call it externally).';
    }

    // Typical controller method:
    public function index(Request $request): mixed
    {
        return 'Called via index method!';
    }

    public function store(Request $request): mixed
    {
        return 'Called via store!';
    }
}
```

```
// routes/web.php
Route::get('/my-action', [MyAction::class, 'index']);
Route::post('/my-action', [MyAction::class, 'store']);
```

Security
--------

[](#security)

If you've found a bug regarding security please mail  instead of using the issue tracker.

LICENSE
-------

[](#license)

The MIT License (MIT). Please see [License](LICENSE.md) file for more information.

###  Health Score

38

—

LowBetter than 84% of packages

Maintenance65

Regular maintenance activity

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~63 days

Total

4

Last Release

245d ago

PHP version history (2 changes)1.0.0PHP ^8.3

1.1.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/68362a494b9a79ded54d1ead1ec5ba58f092dff85eae8a6921565fac8404e19d?d=identicon)[gregupton](/maintainers/gregupton)

---

Top Contributors

[![gregupton](https://avatars.githubusercontent.com/u/54643782?v=4)](https://github.com/gregupton "gregupton (10 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/aesircloud-laravel-actions/health.svg)

```
[![Health](https://phpackages.com/badges/aesircloud-laravel-actions/health.svg)](https://phpackages.com/packages/aesircloud-laravel-actions)
```

###  Alternatives

[illuminate/queue

The Illuminate Queue package.

20331.4M1.2k](/packages/illuminate-queue)[prwnr/laravel-streamer

Events streaming package for Laravel that uses Redis 5 streams

110196.9k1](/packages/prwnr-laravel-streamer)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[saeedvaziry/laravel-async

Run asynchronous code in Laravel without waiting for results

15310.0k](/packages/saeedvaziry-laravel-async)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

3786.5k](/packages/harris21-laravel-fuse)[pmatseykanets/artisan-beans

Easily manage your Beanstalkd job queues right from the Laravel artisan command

4482.1k](/packages/pmatseykanets-artisan-beans)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
