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

        return $this;
    }