PHPackages                             ghofurgiovany/pipeline - 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. ghofurgiovany/pipeline

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

ghofurgiovany/pipeline
======================

v2(3y ago)07MITPHPPHP ^8.1.0

Since Oct 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ghofurgiovanyy/pipeline)[ Packagist](https://packagist.org/packages/ghofurgiovany/pipeline)[ RSS](/packages/ghofurgiovany-pipeline/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Pipelines, Supercharged!
========================

[](#pipelines-supercharged)

[![Example code showcasing the Pipeline package using the with transaction method and the pipable trait](https://raw.githubusercontent.com/GhofurGiovany/pipeline/master/example.png)](https://raw.githubusercontent.com/GhofurGiovany/pipeline/master/example.png)

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

[](#installation)

Install via composer:

```
composer require GhofurGiovany/pipeline
```

Sending pipes down the pipeline
-------------------------------

[](#sending-pipes-down-the-pipeline)

When configuring the pipeline, you can send an array of class strings, invokable objects, closures, objects with a `handle()` method, or any other type that passes `is_callable()`.

```
use GhofurGiovany\Pipeline\Pipeline;

class RegisterController
{
    public function store(StoreRegistrationRequest $request)
    {
        return Pipeline::make()
            ->send($request->all())
            ->through([
                RegisterUser::class,
                AddMemberToTeam::class,
                SendWelcomeEmail::class,
            ])
            ->then(fn ($data) => UserResource::make($data));
    }
}
```

Another approach you can take is to implement this as a trait on a data object. (You could even implement it on your `FormRequest` object if you really wanted.)

```
use GhofurGiovany\Pipeline\Pipable;

class UserDataObject
{
    use Pipable;

    public string $name;
    public string $email;
    public string $password;
    // ...
}

class RegisterController
{
    public function store(StoreRegistrationRequest $request)
    {
        return UserDataObject::fromRequest($request)
            ->pipeThrough([
                RegisterUser::class,
                AddMemberToTeam::class,
                SendWelcomeEmail::class,
            ])
            ->then(fn ($data) => UserResource::make($data));
    }

    // you also can pipe the request

    return $request->pipe()
            ->withTransaction()
            ->through([
                RegisterUser::class,
                AddMemberToTeam::class,
                SendWelcomeEmail::class,
            ])
            ->then(fn ($data) => UserResource::make($data));
}
```

To maintain compatibility with Laravel's `Pipeline` class, the `through()` method can accept either a single array of callables or multiple parameters, where each parameter is one of the callable types listed previously. However, the `pipeThrough()` trait method only accepts an array, since it also has a second optional parameter.

Using database transactions
---------------------------

[](#using-database-transactions)

When you want to use database transactions in your pipeline, the method will be different depending on if you're using the trait or the `Pipeline` class.

Using the `Pipeline` class:

```
Pipeline::make()->withTransaction()
```

The `withTransaction()` method will tell the pipeline to use transactions. When you call the `then()` or `thenReturn()` methods, a database transaction will begin before executing the pipes. If an exception is encountered during the pipeline, the transaction will be rolled back so no data is committed to the database. Assuming the pipeline completed successfully, the transaction is committed.

When using the trait, you can pass a second parameter to the `pipeThrough()` method:

```
$object->pipeThrough($pipes, withTransaction: true);
```

Testing
-------

[](#testing)

```
composer test
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

Total

2

Last Release

1293d ago

### Community

Maintainers

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

---

Tags

laravelpipepipeline

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/ghofurgiovany-pipeline/health.svg)

```
[![Health](https://phpackages.com/badges/ghofurgiovany-pipeline/health.svg)](https://phpackages.com/packages/ghofurgiovany-pipeline)
```

###  Alternatives

[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[chefhasteeth/pipeline

18049.5k1](/packages/chefhasteeth-pipeline)[imanghafoori/laravel-middlewarize

Use laravel middlewares on any method calls in your app

1134.5k1](/packages/imanghafoori-laravel-middlewarize)[efficiently/larasset

Larasset is a library for Laravel 5 which manage assets in an easy way.

684.8k](/packages/efficiently-larasset)[stephenjude/filament-blog

Filament Blog Builder

20317.8k](/packages/stephenjude-filament-blog)[fisharebest/laravel-assets

Asset management for Laravel

208.1k](/packages/fisharebest-laravel-assets)

PHPackages © 2026

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