henzeb/laravel-pipeline-factory is a Laravel package for compose complex pipelines.
It currently has 2 GitHub stars and 77 downloads on Packagist (latest version v1.5.0).
Install it with composer require henzeb/laravel-pipeline-factory.
Discover more Laravel packages by henzeb
or browse all Laravel packages to compare alternatives.
Last updated
Laravel has a convenient Pipeline to be used to separate the logic in a way that allows modifying an object and allows for easy interchangeable components.
Laravel Pipeline Factory takes it a step further and gives you a couple of 'pipes' to help you build a more complex pipeline.
use Illuminate\Support\Facades\Pipeline;
use Henzeb\Pipeline\Facades\Pipe;
use App\Models\User;
$user = User::find(1);
Pipeline::send($user)
->through(
Pipe::events(
Pipe::unless(
UserEnteredPasswordTwice::class,
ReturnInvalidRequestResponse::class
)->else(
Pipe::rescue(
Pipe::transaction(
[
UpdateUser::class,
UpdateAddress::class
]
),
ReturnFailureResponse::class,
)
),
'updateUserDetails'
)
)
Just install with the following command.
composer require henzeb/laravel-pipeline-factory
Every pipe included in this package is invokable. This means you
don't have to stick with handle as it's via method.
The following pipes are available:
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The GNU AGPLv. Please see License File for more information.