Laravel\Lumen\Concerns\RoutesRequests::handleFoundRoute PHP Method

handleFoundRoute() protected method

Handle a route found by the dispatcher.
protected handleFoundRoute ( array $routeInfo ) : mixed
$routeInfo array
return mixed
    protected function handleFoundRoute($routeInfo)
    {
        $this->currentRoute = $routeInfo;
        $this['request']->setRouteResolver(function () {
            return $this->currentRoute;
        });
        $action = $routeInfo[1];
        // Pipe through route middleware...
        if (isset($action['middleware'])) {
            $middleware = $this->gatherMiddlewareClassNames($action['middleware']);
            return $this->prepareResponse($this->sendThroughPipeline($middleware, function () {
                return $this->callActionOnArrayBasedRoute($this['request']->route());
            }));
        }
        return $this->prepareResponse($this->callActionOnArrayBasedRoute($routeInfo));
    }