PHPackages                             elegantly/laravel-workflow - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. elegantly/laravel-workflow

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

elegantly/laravel-workflow
==========================

Workflow for Laravel

v1.0.7(1y ago)12.7k↓30%[4 PRs](https://github.com/ElegantEngineeringTech/laravel-workflow/pulls)MITPHPPHP ^8.2CI passing

Since Sep 21Pushed 1mo agoCompare

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

READMEChangelog (8)Dependencies (12)Versions (12)Used By (0)

Scheduler based Workflow for Laravel
====================================

[](#scheduler-based-workflow-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/51d9ccbcbe21fc70b291e7e23ee91c78ff272c5fbe9ba4de252b7f822ed57b84/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c6567616e746c792f6c61726176656c2d776f726b666c6f772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elegantly/laravel-workflow)[![GitHub Tests Action Status](https://camo.githubusercontent.com/674d590c05918437d7cdca9daaf3a20f7cc1a4c0edc14bcc72db5975b74d43cd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f456c6567616e74456e67696e656572696e67546563682f6c61726176656c2d776f726b666c6f772f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/ElegantEngineeringTech/laravel-workflow/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4c1d5f3b0b5b233d14e1d307500f6180154b85aa9770c956846e6cb82e668013/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f456c6567616e74456e67696e656572696e67546563682f6c61726176656c2d776f726b666c6f772f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/ElegantEngineeringTech/laravel-workflow/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/5d5d106695957e7b8933942229d6a40d94cb65ba4a2e3fe17ed277f530101e05/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c6567616e746c792f6c61726176656c2d776f726b666c6f772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elegantly/laravel-workflow)

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

[](#installation)

You can install the package via composer:

```
composer require elegantly/laravel-workflow
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="workflow-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="workflow-config"
```

This is the contents of the published config file:

```
return [

    'queue' => env('WORKFLOW_QUEUE'),

    'queue_connection' => env('WORKFLOW_QUEUE_CONNECTION'),

];
```

Usage
-----

[](#usage)

### Defining your workflows

[](#defining-your-workflows)

Define a workflow in a class like this one:

```
namespace App\Workflows;

use Carbon\CarbonInterval;
use Elegantly\Workflow\Models\Workflow;
use Elegantly\Workflow\WorkflowDefinition;
use Elegantly\Workflow\WorkflowStep;
use Illuminate\Support\Collection;

class WelcomeUserWorkflow extends WorkflowDefinition
{
    public function __construct(
        public User $user
    ) {
        //
    }

    public function steps(Workflow $workflow): Collection
    {
        return collect()
            ->put(
                'welcome-email',
                WorkflowStep::make($workflow)
                    ->action(function (): void {
                        // send an email to the user
                    })
            )
            ->put(
                'export-user',
                WorkflowStep::make($workflow)
                    ->action(new ExportUserToCrmJob($this->user))
            )
            ->put(
                'product-tour-email',
                WorkflowStep::make($workflow)
                    ->after([
                        'welcome-email' => CarbonInterval::days(3)
                    ])
                    ->action(function (): void {
                        // Send another email to your user
                    })
            )
            ->put(
                'send-promo-code',
                WorkflowStep::make($workflow)
                    ->after([
                        'product-tour-email' => CarbonInterval::days(7),
                    ])
                    ->when(fn() => $this->user->hasNotPurchased())
                    ->action(function (): void {
                        //
                    })
            );
    }
}
```

### Running your workflow

[](#running-your-workflow)

```
use Elegantly\Workflow\Commands\RunWorkflowsCommand;

$schedule->command(RunWorkflowsCommand::class)->everyMinutes();
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Quentin Gabriele](https://github.com/QuentinGab)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance71

Regular maintenance activity

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.3% 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 ~29 days

Recently: every ~52 days

Total

8

Last Release

389d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d769563728757858e249f266ac2555f28db5640124df92821ed17d93ee76fc7b?d=identicon)[QuentinGab](/maintainers/QuentinGab)

---

Top Contributors

[![QuentinGab](https://avatars.githubusercontent.com/u/40128136?v=4)](https://github.com/QuentinGab "QuentinGab (19 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravelElegantlylaravel-workflow

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/elegantly-laravel-workflow/health.svg)

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M626](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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