public function pipe($middleware, array $params = [])
    {
        if (is_callable($middleware)) {
            $this->middlewares[] = $middleware;
        } else {
            $this->middlewares[] = ['class' => $middleware, 'params' => $params];
        }

        return $this;
    }
public function pipe($middleware, array $params = [])
    {
        if (is_callable($middleware)) {
            $this->middlewares[] = $middleware;
        } else {
            $this->middlewares[] = ['class' => $middleware, 'params' => $params];
        }

        return $this;
    }
public function pipe ( $ middleware , array $ params = [ ] ) { if ( is_callable ( $ middleware ) ) { $ this -> middlewares [ ] = $ middleware ; } else { $ this -> middlewares [ ] = [ 'class' => $ middleware , 'params' => $ params ] ; } return $ this ; }
Add a middleware to the runtime collection

@param string $middleware
@param array $params
@return $this
Add a middleware to the runtime collection