zendframework/zend-stratigility
Zend Stratigility is a lightweight middleware pipeline for PHP, built around PSR-7 HTTP messages. Compose request/response processing with reusable middleware, route-like piping, and error handling—ideal for building microservices or adding middleware to existing apps.
Creating an application consists of 3 steps:
use Zend\Stratigility\MiddlewarePipe;
use Zend\Diactoros\Server;
require __DIR__ . '/../vendor/autoload.php';
$app = new MiddlewarePipe();
$server = Server::createServer(
[$app, 'handle'],
$_SERVER,
$_GET,
$_POST,
$_COOKIE,
$_FILES
);
$server->listen(function ($req, $res) {
return $res;
});
The above example is useless by itself until you pipe middleware into the application.
How can I help you explore Laravel packages today?