A simple PHP middleware pipeline. - 一个简单的 PHP 中间件管道。
- PHP >= 7.2
$ composer require coolephp/pipeline --prefer-dist -vvvconfig\app.php add
<?php
return [
/*
* 第三方服务
*/
'providers' => [
...
\Coole\Pipeline\PipelineServiceProvider::class,
...
],
];app('pipeline')
->send($object)
->through($middleware)
// ->with('bar')
// ->via('differentMethod')
// ->thenReturn()
->then(function(){
// middleware is finished
});$ composer testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.