Get the route information for a given route.

@param  \Illuminate\Routing\Route $route

@return array|null
435666
protected function getRouteInformation(Route $route)
    {
        if ($route->getName()) {
            return [
                'uri'        => $route->uri(),
                'name'       => $route->getName(),
                'middleware' => $route->middleware(),
            ];
        }

        return null;
    }
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);
    }
165833
private function getMiddleWareFromRoute(Route $route)
    {
        if (!$route->group) {
            return $route->middleWare;
        }
        $groupMiddleWare = $this->getMiddleWareFromGroup($route->group);
        return \array_merge($groupMiddleWare, $route->middleWare);
    }
861046
private function getMethods(Route $route)
    {
        $methods = $route->getMethods();
        sort($methods);

        return implode('|', $methods) ?: 'ANY';
    }
524797
protected function getRouteInformation(Route $route)
    {
        $methods = implode('|', $route->methods());

        return $this->filterRoute(array(
            'host'       => $route->domain(),
            'method'     => $methods,
            'uri'        => $route->uri(),
            'name'       => $route->getName(),
            'action'     => $route->getActionName(),
            'middleware' => $this->getMiddleware($route),
        ));
    }
260231
public function handle(RouteInterface $route)
    {
        $params = [];

        // create the regex that matches paths against the route
        $patternRegex = $this->createRouteRegex($route, $route->getPattern(), $params);

        // if the route regex matches the current request path
        if (preg_match($patternRegex, $route->getRoute(), $matches)) {
            if (count($matches) > 1) {
                // remove the first match (which is the full route match)
                array_shift($matches);

                // use the extracted parameters as the arguments' keys and the matches as the arguments' values
                return array_combine($params, $matches);
            } else {
                return [];
            }
        }
        // if the route regex does not match the current request path returns null
    }
759386
public function navigationAction($route)
    {
        return $this->render(
            $this->getTemplatePath().'navigation.html.twig',
            array(
                'instance'  => $this->getCurrentInstance(),
                'instances' => $this->getManager()->findAll(),
                'route'     => $route
            )
        );
    }
779931
public function ancestor($route, $path = null)
    {
        if ($path !== null) {
            $page = $this->dispatch($route, true);

            if ($page && $page->path() === $path) {
                return $page;
            }

            $parent = $page ? $page->parent() : null;
            if ($parent && !$parent->root()) {
                return $this->ancestor($parent->route(), $path);
            }
        }

        return null;
    }
632663
public function getModelFromRoute(Route $route)
    {
        $ret = false;
        $controller = $this->getControllerFromRoute($route);

        if ($controller instanceof RestController) {
            $ret = $controller->getModel();
        }

        return $ret;
    }
1148296
public function parseRoute (Route $route) {

		if (preg_match_all('#^' . $route->getRoute () . '$#', $this->getUrl (), $matches, PREG_OFFSET_CAPTURE)) {

			// Rework matches to only contain the matches, not the orig string
			$matches = array_slice($matches, 1);

			// Extract the matched URL parameters (and only the parameters)
			$params = array_map(function($match, $index) use ($matches) {

				// We have a following parameter: take the substring from the current param position until the next one's position (thank you PREG_OFFSET_CAPTURE)
				if (isset($matches[$index+1]) && isset($matches[$index+1][0]) && is_array($matches[$index+1][0])) {
					return trim(substr($match[0][0], 0, $matches[$index+1][0][1] - $match[0][1]), '/');
				}

				// We have no following paramete: return the whole lot
				else {
					return (isset($match[0][0]) ? trim($match[0][0], '/') : null);
				}

			}, $matches, array_keys($matches));

			if (empty ($params)) {
				return true;
			}
			else {
				return $params;
			}
		}

		return false;
	}
789252
public function gatherRouteMiddlewares(LaravelRoute $route)
    {
        $middlewares = [];

        foreach ($route->middleware() as $name) {
            $middlewares[] = $this->resolveMiddlewareClassName($name);
        }
        return Arr::flatten($middlewares);
    }
621386
public function processRouteFilters(Route $route)
	{
		foreach ($this->filterByRoute($route) as $filter) {

			$result = call_user_func_array($filter, func_get_args());
			
			if ($result !== null) {

				return $result;
			}
		}
	}
982124
protected function getRouteInformation(Route $route)
    {
        list($controller, $action) = explode("@", $route->getActionName());

        return [
            'host' => $route->domain(),
            'method' => implode('|', $route->methods()),
            'uri' => $route->uri(),
            'name' => $route->getName(),
            'controller' => $controller,
            'action' => $action,
            'resource' => $route->getActionName(),
            'middleware' => Collection::make($this->getMiddleware($route))
        ];
    }
516169
protected function getRouteResource($route)
	{
		if (!config('openapischemas.resource_tag')) {
			$this->parentCommand->error('The "resource_tag" value in your apischemas.php configuration file must defined.');
			exit();
		}
		$routeAction = $route->getAction();
		list($class, $method) = explode('@', $routeAction['uses']);
		$reflection = new ReflectionClass($class);

		$comment = $reflection->getDocComment();
		if ($comment) {
			$docBlock = $this->docBlockFactory->create($comment);
			foreach ($docBlock->getTags() as $tag) {
				if ($tag->getName() === config('openapischemas.resource_tag')) {
					return $tag->getDescription()->render();
				}
			}
		}

		return null;
	}
1290390
protected function getPatternFilters($route)
    {
        $patterns = [];

        foreach ($route->methods() as $method) {
            $inner = $this->getMethodPatterns($route->uri(), $method);

            $patterns = array_merge($patterns, array_keys($inner));
        }

        return $patterns;
    }
114391
protected function getResponderForFailedRoute(Route $route)
    {
        $rule = $route->failedRule;
        if ($this->has($rule)) {
            return $this->get($rule);
        }

        if (isset($this->defaults[$rule])) {
            return [$this, $this->defaults[$rule]];
        }

        return [$this, 'other'];
    }
749322
public function dispatch(Route $route)
    {
        $callback = $route->getCallback();
        $params = array_values($route->getData());

        if ($callback instanceof Closure) {
            return $this->container->resolveClosure($callback, $params);
        }

        $class = $this->container->make($callback[0]);
        return $this->container->resolveMethod($class, $callback[1], $params);
    }