public function shutdown($request, $response)
    {
        $routeMiddlewares = $this->router->getMiddlewares();

        $middlewares = array_merge(array_filter([$routeMiddlewares]), $this->getMiddleware());

        foreach ($middlewares as $middleware) {
            list($name, $parameters) = $this->pipeline->parsePipeString($middleware);

            $instance = $this->container->make($name);

            if (method_exists($instance, 'shutdown')) {
                $instance->shutdown($request, $response);
            }
        }
    }