Blog Detail


Laravel Pipeline with DB Transaction Support & Handy Methods cover image

Laravel Pipeline with DB Transaction Support & Handy Methods

Laravel Enhanced Pipeline is a package that offers Laravel pipelines with DB transaction support and handy additional methods.


You can install this package using composer:

composer require michael-rubel/laravel-enhanced-pipeline


Import modified pipeline to your class:

use MichaelRubel\EnhancedPipeline\Pipeline;

Then you can make the pipeline:

        // your pipes
    ->onFailure(function ($data, $exception, $pipe) {
        // do something when exception caught

        return $data;
    })->then(function ($data) {
        // do something when all pipes completed their work

        return $data;

You can as well instantiate the pipeline using IoC or manually:


(new Pipeline(app()))

(new Pipeline)

If you want to override the original Pipeline resolved through IoC Container, you can add binding in the ServiceProvider register method:

$this->app->singleton(\Illuminate\Pipeline\Pipeline::class, \MichaelRubel\EnhancedPipeline\Pipeline::class);

For more details, you can visit its documentation and source code on Github.

Published at : 16-06-2022

Author : Rizwan Aslam
Rizwan Aslam

I am a highly results-driven professional with 12+ years of collective experience in the grounds of web application development especially in laravel, native android application development in java, and desktop application development in the dot net framework. Now managing a team of expert developers at Codebrisk.

Launch project