PHPackages                             soap/laravel-workflow-loader - 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. soap/laravel-workflow-loader

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

soap/laravel-workflow-loader
============================

This is my package laravel-workflow-loader

v0.2.1(8mo ago)1122[4 PRs](https://github.com/soap/laravel-workflow-loader/pulls)MITPHPPHP ^8.2CI passing

Since Sep 12Pushed 1mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (15)Versions (21)Used By (0)

Database Loader for Laravel workflow configuration
==================================================

[](#database-loader-for-laravel-workflow-configuration)

[![Latest Version on Packagist](https://camo.githubusercontent.com/239ce3b377541afb98887479e1c5d814cf129cf6f7d3073933c50d9f51c626ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f61702f6c61726176656c2d776f726b666c6f772d6c6f616465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/soap/laravel-workflow-loader)[![GitHub Tests Action Status](https://camo.githubusercontent.com/22629e2ba4c523de3d5c165129061b10c1e9a85edaed2f1c120cd14da5b468a6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f61702f6c61726176656c2d776f726b666c6f772d6c6f616465722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/soap/laravel-workflow-loader/actions?query=workflow%3Arun-tests+branch%3Amain)[![PHPStan](https://github.com/soap/laravel-workflow-loader/actions/workflows/phpstan.yml/badge.svg)](https://github.com/soap/laravel-workflow-loader/actions/workflows/phpstan.yml)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/9dc4d399287e66e51def488782258d7e26115984f1c7d635390a923da908f8c9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f61702f6c61726176656c2d776f726b666c6f772d6c6f616465722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/soap/laravel-workflow-loader/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/aeb0120b2d19412237b305b7af23b4cb6af689ffa082223bd323f2a7ba7318ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f61702f6c61726176656c2d776f726b666c6f772d6c6f616465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/soap/laravel-workflow-loader)

This package extends [zerodahero/laravel-workflow](https://github.com/zerodahero/laravel-workflow) by adding option to store workflow configuration in database. Laravel workflow only support loading configuration form Laravel configuration. This package provides user to change workflow configuration without helping from developers.

Support us
----------

[](#support-us)

You can suggest for any approvement, sponsor this project or make a pull request. I am happy to consider any recommendation. I am not a good programmer so my design may not be the best one. My background is not computer programming. I am an Electrical engineer.

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

[](#installation)

You can install the package via composer:

```
composer require soap/laravel-workflow-loader
```

You can publish and run the migrations with:

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

You can publish the config file with:

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

This is the contents of the published config file:

```
return [
    'loaders' => [
        'database' => [
            'tableNames' => [
                'workflows' => 'workflows',
                'workflow_states' => 'workflow_states',
                'workflow_transitions' => 'workflow_transitions',
                'workflow_state_transitions' => 'workflow_state_transitions',
            ],
            'class' => \Soap\WorkflowLoader\DatabaseLoader::class,
        ],
    ],
];
```

To use this package to load workflow configuration from database, you need to register workflow service provider provided by the package. Zerodahero 's workflow registry will be used to load configuration retreiving from database.

```
php artisan venodr:publish --tag="workflow-loader-provider"

```

This will copy the following WorkflowServiceProvider.php to application providers folder, ensure that it was included in application bootstrap. The following is the content of the file.

```
namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class WorkflowServiceProvider extends ServiceProvider
{
    public function register() {}

    public function boot()
    {
        $registry = app()->make('workflow');
        $workflowLoaderRegistry = app()->make('workflowLoaderRegistry');
        foreach ($workflowLoaderRegistry->all() as $workflow => $config) {
            $registry->addFromArray($workflow, $config);
        }
    }
}
```

This package doesnot provide user interface for user to manage workflow configuration. By design it should be in separate package. I have a plan to create filament plugin to handle this.

Usage
-----

[](#usage)

After you have completed setup, create workflow configuration in database using your own way or provided by other package. Then use them like the one you use by zerohadero/laravel-workflow. Storing configuration in database is easy to develop workflow for user.

Enhance your workflow
---------------------

[](#enhance-your-workflow)

Using [zerodahero/laravel-workflow](https://github.com/zerodahero/laravel-workflow), guards should be created via event subscriber. I developed [soap/laravel-workflow-process](https://github.com/soap/laravel-workflow-process) to use Symfony expression as an upper guard layer. For example, you can write:

```
guard => $subject.isWaitingFor($user) || !$subject.isOwnedBy($user)

```

or

```
guard => $subject.isApprovers($user) || $subject.isReviewers($user)

```

Then the package will inject $subject and $user for you and use Symfony expression to evaluate blocking of the transition.

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)

- [Prasit Gebsaap](https://github.com/soap)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance77

Regular maintenance activity

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~25 days

Recently: every ~86 days

Total

15

Last Release

263d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1073690?v=4)[Prasit Gebsaap](/maintainers/soap)[@soap](https://github.com/soap)

---

Top Contributors

[![soap](https://avatars.githubusercontent.com/u/1073690?v=4)](https://github.com/soap "soap (53 commits)")[![kpscyber](https://avatars.githubusercontent.com/u/126277570?v=4)](https://github.com/kpscyber "kpscyber (48 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravelsoaplaravel-workflow-loader

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[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)

PHPackages © 2026

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