Gather the middleware for the given route with resolved class names.

@param  \Illuminate\Routing\Route  $route
@return array
483824
public function gatherRouteMiddleware(Route $route)
    {
        $middleware = collect($route->gatherMiddleware())->map(function ($name) {
            return (array) MiddlewareNameResolver::resolve($name, $this->middleware, $this->middlewareGroups);
        })->flatten();

        return $this->sortMiddleware($middleware);
    }
1222050
protected function getRouteInformation($route)
    {
        if (!is_a($route, 'Illuminate\Routing\Route')) {
            return [];
        }
        $uri = head($route->methods()) . ' ' . $route->uri();
        $action = $route->getAction();

        $result = [
           'uri' => $uri ?: '-',
        ];

        $result = array_merge($result, $action);


        if (isset($action['controller']) && strpos($action['controller'], '@') !== false) {
            list($controller, $method) = explode('@', $action['controller']);
            if(class_exists($controller) && method_exists($controller, $method)) {
                $reflector = new \ReflectionMethod($controller, $method);
            }
            unset($result['uses']);
        } elseif (isset($action['uses']) && $action['uses'] instanceof \Closure) {
            $reflector = new \ReflectionFunction($action['uses']);
            $result['uses'] = $result['uses'];
        }

        if (isset($reflector)) {
            $filename = ltrim(str_replace(base_path(), '', $reflector->getFileName()), '/');
            $result['file'] = $filename . ':' . $reflector->getStartLine() . '-' . $reflector->getEndLine();
        }

        return $result;
    }
874762
private function parseRoutes(Collection $routes) : array
    {
        $parsedRoutes = [];
        foreach ($routes as $route) {
            $routeUrl = strtr($route->getUrl(), $this->regexShortcuts);

            list($routeRegex, $parameters) = $this->transformRoute($routeUrl);

            $parsedRoute = new Parsed($route);
            $parsedRoute->setPlaceholders($parameters);

            $parsedRoutes[] = [$routeRegex, $parsedRoute];
        }

        return $parsedRoutes;
    }
1077128
public function getRouteProperties($route, Request $request)
    {
        return [$route->uri(), $route->methods(), $route->getAction()];
    }
169868
public function getRouteProperties($route, Request $request)
    {
        if (method_exists($route, 'uri') && method_exists($route, 'methods')) {
            return [$route->uri(), $route->methods(), $route->getAction()];
        }

        return [$route->getUri(), $route->getMethods(), $route->getAction()];
    }
823978
protected function buildRoute(Route $route)
    {
        if ($route->getBlock()) {
            return $route;
        }

        list($pattern, $params) = $this->parsePlaceholders($route->getPattern());
        return $route->setPatternWithoutReset($pattern)->setParams($params)->setBlock(true);
    }
1108522
protected function parseRoute($route)
    {
        $parsedRoute = parse_url($route);

        if (isset($parsedRoute['query'])) {
            parse_str($parsedRoute['query'], $parsedRoute['params']);
        } else {
            $parsedRoute['params'] = [];
        }

        $resolvedRoute = new Resolver(new \common_http_Request($route));
        $this->propagate($resolvedRoute);
        $parsedRoute['extension']         = $resolvedRoute->getExtensionId();
        $parsedRoute['controller']        = $resolvedRoute->getControllerShortName();
        $parsedRoute['controller_class']  = $resolvedRoute->getControllerClass();
        $parsedRoute['action']            = $resolvedRoute->getMethodName();

        return $parsedRoute;
    }
441815
public function resolveRoute($route)
    {
        $routes = $this->sectionRoutes();
        $sId = $this->resolveSectionId($route);

        if (!isset($routes['sections'][$sId])) {
            return '';
        }

        return $routes['sections'][$sId];
    }
1203279
public function get($route, $params = [])
    {
        $route = $this->parseRoute($route, $params);
        $request = Request::create($route, 'GET');
        $response = Route::dispatch($request);

        return $response;
    }
97482
public function gatherRouteMiddlewares(Route $route)
    {
        return Collection::make($route->middleware())->map(function ($m) {
            return Collection::make(array_get($this->middleware, $m, $m));
        })->collapse()->all();
    }
709352
protected function gatherInvokerMiddleware($middleware)
    {
        $nameMiddleware = $this->config['name_middleware'] ?? [];
        $middlewareGroups = $this->config['middleware_groups'] ?? [];

        return Collection::make($middleware)->map(function ($middleware) use ($nameMiddleware, $middlewareGroups) {
            return (array) MiddlewareNameResolver::resolve($middleware, $nameMiddleware, $middlewareGroups);
        })->flatten()->all();
    }
12880
protected function compileRoute(Route $route): array
    {
        $regex = '';
        $prefix = '';
        $prio = 0;
        $pre = true;
        
        $wildcard = false;
        
        foreach (\explode('/', $route->pattern) as $level => $entry) {
            if (!$level) {
                continue;
            }
            
            if ($wildcard) {
                throw new \RuntimeException('No additional path segments are allowed after wildcard matcher');
            }
            
            if ($pre) {
                $prefix .= '/';
            } else {
                $regex .= '/';
            }
            
            $prio += 1000;
            
            if (false === \strpos($entry, '{')) {
                if ($pre) {
                    $prefix .= $entry;
                } else {
                    $regex .= \preg_quote($entry, "'");
                }
                
                $prio += 2;
                
                continue;
            }
            
            $pre = false;
            
            $parts = \preg_split("'(\\{[^\\}]+\\})'", $entry, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
            $boost = 0;
            
            foreach ($parts as $part) {
                if ($part[0] != '{') {
                    $regex .= \preg_quote($part, "'");
                    $boost += 2;
                    
                    continue;
                }
                
                if (\substr($part, -2) == '*}') {
                    $regex .= '(.+)';
                    $wildcard = true;
                    
                    break;
                }
                
                $regex .= '([^/]+)';
                $boost -= 1;
            }
            
            if ($wildcard) {
                if (\count($parts) !== 1) {
                    throw new \RuntimeException('Wildcard patern must be the only placeholder of the last route level');
                }
                
                $prio -= 500;
            } else {
                $prio += $boost;
            }
        }
        
        return [
            $route,
            $prio,
            '/' . \ltrim($prefix, '/'),
            $regex
        ];
    }
612457
public function getRouteMiddleware($route)
    {
        return collect($route->gatherMiddleware())->map(function ($middleware) {
            return $middleware instanceof Closure ? 'Closure' : $middleware;
        })->implode(',');
    }
711774
public function getDefaults($route)
    {
        $route = $this->router->getRouteCollection()->get($route);
        if ($route) {
            $defaults = $route->getDefaults();

            return $defaults;
        }

        return array();
    }
1188241
private function mapRoute2Content($route)
    {
        // Look it up in the index
        list($keyIndex, $content) = $this->mapRoute2Index($route);
        $filtered = $this->loadFileContentPhaseOne($keyIndex);

        return [$keyIndex, $content, $filtered];
    }
189363
public function get($route)
    {
        if (false === $this->has($route)) {
            return null;
        }

        return $this->generators[$route];
    }
813167
public function getFromRequest($route = null) {
        $resolvers = [];
        foreach ($this->segmentsResolvers as $key => $resolverClass) {
            if( $bindedClass = request()->route($key) ) {
                $resolvers[$key] = new $resolverClass($bindedClass);
            }
        }
        // sort resolvers in same order they are in request
        if (!empty($resolvers)) {
            if (empty($route)) {
                $route = \Route::getCurrentRoute()->uri();
            }       
            $segments = explode('/', $route);
            $sortedResolvers = [];
            foreach($segments as $segment) {
                $segment = trim($segment, "{}");
                if (isset($resolvers [$segment])) {
                    $sortedResolvers[$segment] = $resolvers[$segment];
                }
            }
            $resolvers = $sortedResolvers;
        }
        return empty($resolvers) ? false  : $resolvers;
    }