yuriitatur/pipeline

A simple pipeline for running middleware

v1.0.0 2025-08-04 16:44 UTC

This package is auto-updated.

Last update: 2025-08-04 16:45:20 UTC


README

Quality Gate Status Coverage

Simple middleware pipe | refined Laravel's pipes

Installation

composer require yuriitatur/pipeline

Usage

class AuthMiddleware implements MiddlewareInterface
{
    public function handle(&$request, \Closure $next, ...$roles): mixed
    {
        #...do some magic
    }
}

$pipe = new Pipeline();
$response = $pipe->send($request)
    ->through(new AuthMiddleware, 'admin', 'super_admin')
    ->through(new SomeOtherMiddleware)
    ->then(function($request){
        #...handle the request
    });

Testing

composer test

License

This code is under MIT license, read more in the LICENSE file.