An array access get to conveniently
create an empty route with the optional name
@param string $name
@return Route
507875
public function offsetGet($name)
    {
        if(isset($this->routes[$name]))
            return $this->routes[$name];

        $route = $this->factory->createRoute($this, $name, array());

        $this->addRoute($route);

        return $this->routes[$name] = $route;
    }
947258
public function get(string $name){
        foreach($this->routes as $route){
			if($route->matchName($name))
				return $route;
		}
		return null;
    }
407875
public function route($routeName = null)
    {
        if (null !== $routeName) {
            $this->routeName = $routeName;

            return $this;
        }

        return $this->routeName;
    }
171898
public function getRoute($name, array $args = [])
    {
        if (!isset($this->names[$name])) {
            return null;
        }

        $route = $this->callbacks[$this->names[$name]];

        if (strpos($route->pattern, '(') === false) {
            // If we don't have any route parameters, just return the pattern
            // straight off. No need for any regex stuff.
            return $route->pattern;
        }

        // Convert all placeholders to %o = optional and %r = required
        $from    = ['/(\([^\/]+[\)]+[\?])/', '/(\([^\/]+\))/'];
        $to      = ['%o', '%r'];
        $pattern = preg_replace($from, $to, $route->pattern);

        $frags = explode('/', trim($pattern, '/'));
        $url   = [];

        // Loop thru the pattern fragments and insert the arguments
        foreach ($frags as $frag) {
            if ($frag == '%r') {
                if (!$args) {
                    // A required parameter, but no more arguments.
                    throw new Exception('Missing route parameters');
                }
                $url[] = array_shift($args);
                continue;
            }

            if ($frag == "%o") {
                if (!$args) {
                    // No argument for the optional parameter,
                    // just continue the iteration.
                    continue;
                }
                $url[] = array_shift($args);
                continue;
            }

            $url[] = $frag;
        }

        return '/' . implode('/', $url);
    }
1092433
public function name($name)
    {
        $this->name = $name;

        $routes = (array) $this->config['app.routes'];

        $this->config['app.routes'] = array_merge(
            $routes,
            [$name => $this->getPath()]
        );
    }
385892
public function bindRouteCollection($name = "")
    {
        $routeCollection = new RouteCollection($this->paths['app'].'/routes.yml', $this->paths, $name, $this->parser);

        return $routeCollection;
    }
714966
public function getNamedRoute(string $name) : Route
    {
        $this->buildNameIndex();

        if (isset($this->namedRoutes[$name])) {
            return $this->namedRoutes[$name];
        }

        throw new InvalidArgumentException(sprintf('No route of the name (%s) exists', $name));
    }
698020
protected function getRouteName($name)
    {
        $name = Str::replaceFirst($this->getDefaultNamespace(trim($this->rootNamespace(), '\\')).'\\', '', $name);
        $name = 'Api\\'.Str::replaceLast('Controller', '', $name);
        $names = explode('\\', $name);
        foreach ($names as $key => $value) {
            $names[$key] = snake_case($value);
        }
        if ($this->option('parent') && count($names) >= 2) {
            $model = str_plural(array_pop($names));
            $parent = str_plural(array_pop($names));
            array_push($names, $parent, $model);
        } elseif (($this->option('model') || $this->option('resource')) && count($names) >= 1) {
            $model = str_plural(array_pop($names));
            array_push($names, $model);
        }
        $name = implode('.', $names);

        return str_replace('\\', '.', $name);
    }
487043
public function routeNameToUrlString($name, array $args = [])
    {
        foreach ($args as $offset => $arg) {
            if ( !$arg ) {
                unset($args[ $offset ]);
            }
        }

        try {
            $url = $this->generate($name, $args);
        } catch (RouteNotFound $exception) {
            try {
                $newName = 'default.' . $name;
                $url     = $this->generate($newName, $args);
            } catch (RouteNotFound $e) {
                throw new RouteNotFound(sprintf('Route with name "%s" or "%s" not found', $newName, $name));
            }
        }

        if ( FALSE !== strstr($url, '{') ) {
            throw new RouteNotFound(
                sprintf('Route with name "%s" needs parameters. Temporary resulted into: %s', $name, $url)
            );
        }

        return $this->request->getBaseUrl() . $url;
    }
407439
public function route($name)
    {
        if (array_key_exists($name, $this->allNames)) {
            return $this->allNames[$name];
        }

        return null;
    }
681180
public function filterByName($name)
    {
        return $this->filter(function (Route $route) use ($name)
        {
            return $route->getName() === $name;
        });
    }
920446
protected function getUrlFromRoute($name, Route $route)
    {
        $option = $route->getOption('sitemap');
        
        if ($option === null) {
            return null;
        }
        if (is_string($option)) {
            $decoded = json_decode($option, true);
            if (!json_last_error() && is_array($decoded)) {
                $option = $decoded;
            }
        }
        if (!is_array($option) && !is_bool($option)) {
            $bool = filter_var($option, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
            if (null === $bool) {
                throw new \InvalidArgumentException("The sitemap option for route $name must be boolean or array");
            }
            $option = $bool;
        }
        if (!$option) {
            return null;
        }
        $url = $this->router->generate($name);
        
        $urlObject = new Url(
                $url,
                (isset($option['lastMod']) ? $option['lastMod'] : null),
                (isset($option['priority']) ? $option['priority'] : null),
                (isset($option['changeFreq']) ? $option['changeFreq'] : null)
        );
        
        return $urlObject;
    }
1300756
public static function get($name = 'default')
    {
        if (!isset(self::$connections[$name])) {
            return null;
        }

        $connector = self::$connections[$name];

        return $connector->connection();
    }
1356102
public static function get($name, $options = [])
    {
        $default = isset($options["default"]) ? $options["default"] : null;

        return isset($_REQUEST[$name]) ? $_REQUEST[$name]: $default;
    }
731891
public function action($name = null)
    {
        if ($name) {
            $this->action = $name;
        }

        if ($this->action) {
            return $this->action;
        }

        // Wildcard
        return Route::currentRouteAction();
    }
1320117
public function getParameters(string $name = null)
    {
        if (is_null($name)) {
            return $this->getRoute('parameters');
        }

        return $this->getRoute('parameters', $name);
    }
108256
public function get($name)
    {
        $value = $this->cache->get($name);

        return is_array($value)
            ? new Location($value)
            : null;
    }