Get the route for a route name.

@param string $routeName
@return array|null
343702
private function getRouteByName($routeName)
    {
        if (isset($this->app->router) && $this->app->router instanceof \Laravel\Lumen\Routing\Router) {
            $router = $this->app->router;
        } else {
            // backward compatibility with lumen 5.3
            $router = $this->app;
        }
        foreach ($router->getRoutes() as $route) {
            if (isset($route['action']['as']) && $route['action']['as'] == $routeName) {
                return $route;
            }
        }
        $this->fail("Route with name '$routeName' does not exist");
        return null;
    }
540857
final public function urlFor($routeName, array $params = array())
    {
        if (null === $this->router) {
            return '';
        }

        return $this->router->urlFor($routeName, $params);
    }
1317905
public function findRoute($name)
    {
        if(isset($this->routes[$name]))
            return $this->routes[$name];

        // alias check
        if(isset($this->aliasIndices[$name])) {
            $name = $this->aliasIndices[$name];
        } else {
            foreach($this->groupAliasIndices as $alias => $routeName) {
                if(strpos($name, $alias) === 0) {
                    $name = substr_replace($name, $routeName, 0, strlen($alias));
                    break;
                }
            }
        }

        if($route = $this->findRouteRecursively($name))
            return $this->routes[$name] = $route;

        return false;
    }
705166
public function getRoute($path = null)
    {
        // check the path
        if (!$path || ($this->path && $path != $this->path)){
            $urlParts = $this->urlPart;
        } else {
            $urlParts = $this->parsePath($path);
        }
        return $this->routeSystem->getRoute($urlParts);
    }
1320117
public function getParameters(string $name = null)
    {
        if (is_null($name)) {
            return $this->getRoute('parameters');
        }

        return $this->getRoute('parameters', $name);
    }
134278
public function get($name)
    {
        return isset($this->routes[$name]) ? $this->routes[$name] : null;
    }
295274
public function getRoute($name)
    {
        if (empty($name)) {
            throw new \InvalidArgumentException("Route name not provided.");
        }

        // TODO: This is not very efficient, maybe find a better way
        foreach ($this->routes as $route) {
            if ($route->getName() === $name) {
                return $route;
            }
        }

        throw new \Exception("Route \"$name\" not found.");
    }
1251886
public function getRouteGroup(string $groupName)
  {
    foreach ($this->routeGroups as $routeGroup)
    {
      if ( \strcasecmp($routeGroup->getName(),$groupName)==0 ) {
        return $routeGroup;
      }
    }

    return null;
  }
541229
public function get($name)
    {
        if (! isset($this->routes[$name])) {
            throw new InvalidArgumentException(
                sprintf('The route with given name "%s" not exists.', $name)
            );
        }

        return $this->routes[$name];
    }
982434
public function getRoute($route = null)
    {
        $routes = $this->getConsole()->getRoutes($route);
        $l1 = 10; $l2 = 10; $l3 = 10;
        $list = "";
        foreach($routes as $route) {
            if($l1 < strlen($route[1])) {
                $l1 = strlen($route[1]);
            }
            if($l2 < strlen($route[0])) {
                $l2 = strlen($route[0]);
            }
            if($l3 < strlen($route[2])) {
                $l3 = strlen($route[2]);
            }
        }
        foreach($routes as $route) {
            $list .= 
"| $route[1]".str_repeat(' ',$l1-strlen($route[1]))." | $route[0]".str_repeat(' ',$l2-strlen($route[0]))." | $route[2]".str_repeat(' ',$l3-strlen($route[2]))." |
+".str_repeat('-',$l1+2)."+".str_repeat('-',$l2+2)."+".str_repeat('-',$l3+2)."+
";
        }
        $list = "
+".str_repeat('-',$l1+2)."+".str_repeat('-',$l2+2)."+".str_repeat('-',$l3+2)."+
| ".Colors::GREEN.Colors::BG_BLACK."URI".Colors::WHITE.Colors::BG_BLACK.str_repeat(' ',$l1-strlen('URI'))." | ".Colors::GREEN.Colors::BG_BLACK."Method".Colors::WHITE.Colors::BG_BLACK.str_repeat(' ',$l2-strlen('Method'))." | ".Colors::GREEN.Colors::BG_BLACK."Action".Colors::WHITE.Colors::BG_BLACK.str_repeat(' ',$l3-strlen('Action'))." |
+".str_repeat('-',$l1+2)."+".str_repeat('-',$l2+2)."+".str_repeat('-',$l3+2)."+
".$list;
        return $list;
    }
947248
public function get($route_name) {
    $route = null;

    if(!array_key_exists($route_name, $this->routes))
      echo "Router: error: the array key $route_name doesn't exists.<br />";
    else { 
      $route_infos = $this->routes[$route_name];
      
      if($route_controller = $this->instancy_controller($route_infos[1])) {
        $route = array($route_controller, $route_infos[2]);
      }
    }
   
    return $route;
  }
526951
public static function getRoute($route, $method=null) {
// 		$routes	= static::getRoutes();
		if( $method ) {
			return isset(static::$routes[$route][$method]) ? static::$routes[$route][$method] : null;
		}
		foreach( static::getKnownMethods() as $method ) {
			if( isset(static::$routes[$route][$method]) ) {
				return static::$routes[$route][$method];
			}
		}
		return null;
	}
533307
public function seeCurrentRouteIs($routeName)
    {
        if (!$this->di->has('url')) {
            $this->fail('Unable to resolve "url" service.');
        }

        /** @var Url $url */
        $url = $this->di->getShared('url');
        $this->seeCurrentUrlEquals($url->get(['for' => $routeName], null, true));
    }
651528
public function extractId($routeName)
    {
        if (!$this->supports($routeName)) {
            return null;
        }

        return (int) str_replace($this->getPrefix(), '', $routeName);
    }
1051576
public function getRoute(string $routeKey, array $params = []): string
    {
        $this->checkRouteIsDefined($routeKey);

        return route(
            $this->getAttribute('routes')[$routeKey]['alias'],
            array_merge($this->getAttribute('routes')[$routeKey]['parameters'], $params)
        );
    }
758187
public function getNamedRoute($name)
    {
        $this->getNamedRoutes();
        if ($this->hasNamedRoute($name)) {
            return $this->namedRoutes[(string) $name];
        } else {
            return null;
        }
    }
1325947
public static function get($name)
    {
        if ( ! isset(Route::$routeInstances[$name]))
        {
            Base::getLog()->error(__METHOD__ . ' getting unknown route', [
                'name'   => $name,
                'exists' => array_keys(self::$routeInstances),
            ]);
            throw new RouteNotFoundException('The requested route does not exist: :route', [
                ':route' => $name
            ]);
        }

        return Route::$routeInstances[$name];
    }