Returns route by given name

@param string $name
@return \PHPLegends\Routes\Route | null
336766
public function findByName($name)
	{
		return $this->routes->first(function ($route) use($name)
		{
			return $route->getName() === $name;
		});
	}
1363871
public function get($name) {
        $query = $this->queryAll();
        return isset($query[$name]) ? $query[$name] : null;
    }
1286421
protected function getInstance($name)
    {
        $route = &$this->routes[$name];

        if (null === $route['instance']) {
            $route['instance'] = $this->routeManager->build(
                !isset($route['options']['type']) ? 'Generic' : $route['options']['type'],
                $route['options']
            );
        }

        return $route['instance'];
    }
1173140
public function getRoute($name, array $args = [])
    {
        $name = strtolower($name);

        if (isset($this->routes[$name])) {
            $route = $this->routes[$name];

            foreach ($args as $k => $v) {
                $route = str_replace(':' . $k, $v, $route);
            }
            return $route;
        }
        return null;
    }
731891
public function action($name = null)
    {
        if ($name) {
            $this->action = $name;
        }

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

        // Wildcard
        return Route::currentRouteAction();
    }
612091
public function getPath(string $name = null)
    {
        if (is_null($name)) {
            return $this->get('path');
        }

        return $this->get('path', $name);
    }
1199644
protected function getPath($name)
    {
        $name = Str::replaceFirst($this->rootNamespace(), '', $name);

        return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';
    }
1351761
private function findRoute($name)
    {
        if (null === $this->routes) {
            $i18nRouterClass = 'JMS\I18nRoutingBundle\Router\I18nRouterInterface';
            if (interface_exists($i18nRouterClass) && $this->router instanceof $i18nRouterClass) {
                $this->routes = $this->router->getOriginalRouteCollection();
            } else {
                $this->routes = $this->router->getRouteCollection();
            }
        }

        return $this->routes->get($name);
    }
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;
    }
1153071
public function get($name)
    {
        $name = strtoupper($name);
        if (isset($_SERVER[$name])) {
            return $_SERVER[$name];
        }
        return null;
    }
4314
public function getEndpoint($name)
    {
        return array_key_exists($name, $this->endpointsByName) ? $this->endpointsByName[$name] : null;
    }
373088
protected function getPath($name)
	{
		$name = str_replace($this->getAppNamespace(), '', $name);

		return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';
	}
1206724
public function get(string $name)
    {
        return isset($this->headers[$name]) ? $this->headers[$name] : null;
    }
681180
public function filterByName($name)
    {
        return $this->filter(function (Route $route) use ($name)
        {
            return $route->getName() === $name;
        });
    }
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.");
    }
375544
public function getRoute($name)
    {
        if (! $this->hasRoute($name)) {
            throw new \Exception($name);
        }
        return $this->routes[$name];
    }
383725
public function get(string $name)
    {
        if (!array_key_exists($name, $this->headers)) {
            return null;
        }

        return $this->headers[$name];
    }