PHPackages                             juststeveking/laravel-business-process - 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. juststeveking/laravel-business-process

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

juststeveking/laravel-business-process
======================================

Laravel Business Process is a simple and clean way to run business process using a Laravel Pipeline, in a structured and type-safe way.

0.0.1(3y ago)663.7k↑153.3%1[1 issues](https://github.com/JustSteveKing/laravel-business-process/issues)MITPHPPHP ^8.2

Since Apr 27Pushed 3y ago2 watchersCompare

[ Source](https://github.com/JustSteveKing/laravel-business-process)[ Packagist](https://packagist.org/packages/juststeveking/laravel-business-process)[ GitHub Sponsors](https://github.com/JustSteveKing)[ RSS](/packages/juststeveking-laravel-business-process/feed)WikiDiscussions main Synced 2d ago

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

Laravel Business Process
========================

[](#laravel-business-process)

[![Latest Version](https://camo.githubusercontent.com/1591b4cf74e3c91cc3a9a6e8a7c9264086e1c7282a531c2f27f1f01234b32485/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a75737473746576656b696e672f6c61726176656c2d627573696e6573732d70726f636573732e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/juststeveking/laravel-business-process)[![Software License](https://camo.githubusercontent.com/7c396b721961252af5cabf206ce72405de697f370aba0f4e0166da964fc99fb2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a75737473746576656b696e672f6c61726176656c2d627573696e6573732d70726f636573732e7376673f7374796c653d666c61742d737175617265)](https://github.com/juststeveking/laravel-business-process/blob/main/LICENSE)[![Run Tests](https://github.com/JustSteveKing/laravel-business-process/actions/workflows/tests.yml/badge.svg)](https://github.com/JustSteveKing/laravel-business-process/actions/workflows/tests.yml)[![PHP Version](https://camo.githubusercontent.com/458b7b603e53ceaea7687ac72417e98cbb10d6eeeb0e45ad2b3c707142bf697b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a75737473746576656b696e672f6c61726176656c2d627573696e6573732d70726f636573732e7376673f7374796c653d666c61742d737175617265)](https://php.net)[![Total Downloads](https://camo.githubusercontent.com/8445c8a8f58b909436d1e8e9ae91384fbcc27120009e110a6e99a594d10d17f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a75737473746576656b696e672f6c61726176656c2d627573696e6573732d70726f636573732e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6d656469756d76696f6c6574726564)](https://packagist.org/packages/juststeveking/laravel-business-process)

Laravel Business Process is a simple and clean way to run business process using a Laravel Pipeline, in a structured and type-safe way.

This package is inspired by the tutorial I wrote for Laravel News [Going Past Actions in Laravel](https://laravel-news.com/going-past-actions-in-laravel).

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

[](#installation)

```
composer require juststeveking/laravel-business-process
```

Usage
-----

[](#usage)

To get started with this package, all you need to do is create a new process class:

```
use JustSteveKing\BusinessProcess\Process;

final class PurchaseProduct extends Process
{
    protected array $tasks = [
        CheckStockLevel::class,
        ProcessOrder::class,
        DecreaseStockLevel::class,
        NotifyWarehouse::class,
        EmailCustomer::class,
    ];
}
```

Our process class registers the tasks that need to be completed for this process to run, each task must implement the `TaskContract` interface that comes with this package.

```
use JustSteveKing\BusinessProcess\Contracts\TaskContract;

final class CheckStockLevel implements TaskContract
{
    public function __invoke(ProcessPayload $payload, Closure $next): mixed
    {
        // perform your logic here with the passed in payload.

        return $next($payload);
    }
}
```

Your tasks are standard classes that the `Pipeline` class from Laravel would expect.

The payload is a class that implements `ProcessPayload` interface, signalling that it is a payload for a process. They are simple plain old PHP classes with no requirements to add methods.

```
use JustSteveKing\BusinessProcess\Contracts\ProcessPayload;

final class PurchaseProductPayload implements ProcessPayload
{
    public function __construct(
        // add whatever public properties you need here
        public int $product,
        public int $user,
        public int $order,
    ) {}
}
```

Finally, we can call this process within our controller/job/cli wherever you need to.

```
final class PurchaseController
{
     public function __construct(
        private readonly PurchaseProduct $process,
     ) {}

     public function __invoke(PurchaseRequest $request, int $product): JsonResponse
     {
        try {
            $this->process->run(
                payload: $request->payload(),
            );
        } catch (Throwable $exception) {
            // Handle exception
        }

        // return response.
     }
}
```

Testing
-------

[](#testing)

To run the test:

```
composer run test
```

Credits
-------

[](#credits)

- [Steve McDougall](https://github.com/JustSteveKing)
- [All Contributors](../../contributors)

LICENSE
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

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

Unknown

Total

1

Last Release

1164d ago

### Community

Maintainers

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

---

Top Contributors

[![JustSteveKing](https://avatars.githubusercontent.com/u/6368379?v=4)](https://github.com/JustSteveKing "JustSteveKing (2 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/juststeveking-laravel-business-process/health.svg)

```
[![Health](https://phpackages.com/badges/juststeveking-laravel-business-process/health.svg)](https://phpackages.com/packages/juststeveking-laravel-business-process)
```

###  Alternatives

[timothyasp/nova-badge-field

A Laravel Nova field.

58570.8k](/packages/timothyasp-nova-badge-field)[airmanbzh/php-html-generator

PHP html generator

8376.0k5](/packages/airmanbzh-php-html-generator)[koolreport/laravel

Allow to use KoolReport seamlessly in Laravel

18277.7k](/packages/koolreport-laravel)[lillik/module-seo-pagination

Magento 2 Seo Pagination

1014.2k](/packages/lillik-module-seo-pagination)[blockpc/select2-wire

Free Select2 Livewire package

251.3k](/packages/blockpc-select2-wire)

PHPackages © 2026

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