PHPackages                             itsmill3rtime/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. itsmill3rtime/laravel-actions

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

itsmill3rtime/laravel-actions
=============================

Laravel components that take care of one specific task

v1.0(1y ago)03MITPHPPHP ^8.1

Since Feb 26Pushed 1y agoCompare

[ Source](https://github.com/itsmill3rtime/laravel-actions)[ Packagist](https://packagist.org/packages/itsmill3rtime/laravel-actions)[ Docs](https://github.com/lorisleiva/laravel-actions)[ GitHub Sponsors](https://github.com/sponsors/lorisleiva)[ RSS](/packages/itsmill3rtime-laravel-actions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

⚡️ Laravel Actions
==================

[](#️-laravel-actions)

[![Latest Version on Packagist](https://camo.githubusercontent.com/df4e4d6345d9ffca09c2c3e52c2326ab05768d52ef625b2a4eea07296e0816b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f7269736c656976612f6c61726176656c2d616374696f6e732e737667)](https://packagist.org/packages/lorisleiva/laravel-actions)[![GitHub Tests Action Status](https://camo.githubusercontent.com/977dbea60770cd2ed6c5a30f7327972e9c4165d7eb17f5cc45642dc6dfd75025/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6f7269736c656976612f6c61726176656c2d616374696f6e732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e)](https://github.com/lorisleiva/laravel-actions/actions?query=workflow%3ATests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/67168e5dded0b155314e91e25ef68b05774885b76d354d8b65511a2ace0a78d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6f7269736c656976612f6c61726176656c2d616374696f6e732e737667)](https://packagist.org/packages/lorisleiva/laravel-actions)

[![hero](https://user-images.githubusercontent.com/3642397/104024620-4e572400-51bb-11eb-97fc-c2692b16eaa7.png)](https://user-images.githubusercontent.com/3642397/104024620-4e572400-51bb-11eb-97fc-c2692b16eaa7.png)

⚡ **Classes that take care of one specific task.**

This package introduces a new way of organising the logic of your Laravel applications by focusing on the actions your applications provide.

Instead of creating controllers, jobs, listeners and so on, it allows you to create a PHP class that handles a specific task and run that class as anything you want.

Therefore it encourages you to switch your focus from:

> "What controllers do I need?", "should I make a FormRequest for this?", "should this run asynchronously in a job instead?", etc.

to:

> "What does my application actually do?"

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

[](#installation)

```
composer require lorisleiva/laravel-actions
```

Documentation
-------------

[](#documentation)

📚 Read the full documentation at [laravelactions.com](https://laravelactions.com/)

Basic usage
-----------

[](#basic-usage)

Create your first action using `php artisan make:action PublishANewArticle` and define the `asX` methods when you want your action to be running as `X`. E.g. `asController`, `asJob`, `asListener` and/or `asCommand`.

```
class PublishANewArticle
{
    use AsAction;

    public function handle(User $author, string $title, string $body): Article
    {
        return $author->articles()->create([
            'title' => $title,
            'body' => $body,
        ]);
    }

    public function asController(Request $request): ArticleResource
    {
        $article = $this->handle(
            $request->user(),
            $request->get('title'),
            $request->get('body'),
        );

        return new ArticleResource($article);
    }

    public function asListener(NewProductReleased $event): void
    {
        $this->handle(
            $event->product->manager,
            $event->product->name . ' Released!',
            $event->product->description,
        );
    }
}
```

### As an object

[](#as-an-object)

Now, you can run your action as an object by using the `run` method like so:

```
PublishANewArticle::run($author, 'My title', 'My content');
```

### As a controller

[](#as-a-controller)

Simply register your action as an invokable controller in a routes file.

```
Route::post('articles', PublishANewArticle::class)->middleware('auth');
```

### As a listener

[](#as-a-listener)

Simply register your action as a listener of the `NewProductReleased` event.

```
Event::listen(NewProductReleased::class, PublishANewArticle::class);
```

Then, the `asListener` method of your action will be called whenever the `NewProductReleased` event is dispatched.

```
event(new NewProductReleased($manager, 'Product title', 'Product description'));
```

### And more...

[](#and-more)

On top of running your actions as objects, controllers and listeners, Laravel Actions also supports jobs, commands and even mocking your actions in tests.

📚 [Check out the full documentation to learn everything that Laravel Actions has to offer](https://laravelactions.com/).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance44

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.2% 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

Unknown

Total

1

Last Release

440d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2539808?v=4)[Jimmy](/maintainers/itsmill3rtime)[@itsmill3rtime](https://github.com/itsmill3rtime)

---

Top Contributors

[![lorisleiva](https://avatars.githubusercontent.com/u/3642397?v=4)](https://github.com/lorisleiva "lorisleiva (439 commits)")[![mortenscheel](https://avatars.githubusercontent.com/u/6514342?v=4)](https://github.com/mortenscheel "mortenscheel (19 commits)")[![patrickomeara](https://avatars.githubusercontent.com/u/571773?v=4)](https://github.com/patrickomeara "patrickomeara (3 commits)")[![Wulfheart](https://avatars.githubusercontent.com/u/25671390?v=4)](https://github.com/Wulfheart "Wulfheart (3 commits)")[![edwinvdpol](https://avatars.githubusercontent.com/u/9265514?v=4)](https://github.com/edwinvdpol "edwinvdpol (2 commits)")[![jaulz](https://avatars.githubusercontent.com/u/5358638?v=4)](https://github.com/jaulz "jaulz (2 commits)")[![authanram](https://avatars.githubusercontent.com/u/1874088?v=4)](https://github.com/authanram "authanram (2 commits)")[![d8vjork](https://avatars.githubusercontent.com/u/2331052?v=4)](https://github.com/d8vjork "d8vjork (2 commits)")[![dmason30](https://avatars.githubusercontent.com/u/20278756?v=4)](https://github.com/dmason30 "dmason30 (2 commits)")[![itsmill3rtime](https://avatars.githubusercontent.com/u/2539808?v=4)](https://github.com/itsmill3rtime "itsmill3rtime (2 commits)")[![0xflotus](https://avatars.githubusercontent.com/u/26602940?v=4)](https://github.com/0xflotus "0xflotus (2 commits)")[![morrislaptop](https://avatars.githubusercontent.com/u/67807?v=4)](https://github.com/morrislaptop "morrislaptop (2 commits)")[![istiak-tridip](https://avatars.githubusercontent.com/u/13367189?v=4)](https://github.com/istiak-tridip "istiak-tridip (1 commits)")[![it-can](https://avatars.githubusercontent.com/u/644288?v=4)](https://github.com/it-can "it-can (1 commits)")[![TaylorWilton](https://avatars.githubusercontent.com/u/6993833?v=4)](https://github.com/TaylorWilton "TaylorWilton (1 commits)")[![travisaustin](https://avatars.githubusercontent.com/u/1134334?v=4)](https://github.com/travisaustin "travisaustin (1 commits)")[![jenky](https://avatars.githubusercontent.com/u/1808758?v=4)](https://github.com/jenky "jenky (1 commits)")[![ksassnowski](https://avatars.githubusercontent.com/u/5139098?v=4)](https://github.com/ksassnowski "ksassnowski (1 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![leandrodiogenes](https://avatars.githubusercontent.com/u/2463299?v=4)](https://github.com/leandrodiogenes "leandrodiogenes (1 commits)")

---

Tags

laravelobjectjoblistenercommandcomponentcontrolleraction

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[lorisleiva/laravel-actions

Laravel components that take care of one specific task

2.8k7.5M115](/packages/lorisleiva-laravel-actions)[imtigger/laravel-job-status

Laravel Job Status

5272.1M3](/packages/imtigger-laravel-job-status)[mxl/laravel-job

Laravel job tools

661.3M](/packages/mxl-laravel-job)[mpbarlow/laravel-queue-debouncer

A wrapper job for debouncing other queue jobs.

63714.4k1](/packages/mpbarlow-laravel-queue-debouncer)[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)
