PHP code example of bauhaus / middleware-chain

1. Go to this page and download the library: Download bauhaus/middleware-chain library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bauhaus / middleware-chain example snippets




use Bauhaus\MiddlewareChain;
use SomeVendor\Middleware1;
use AnotherVendor\Middleware2;

$diContainer = 
$chain->stackUp(Middleware2::class); // This will be loaded with $diContainer->get(Middleware2::class)

$response = $chain->handle($request);