Get a URL for a given route name
@param string $routeName
@param array $params (optional)
@return string
194497
public function urlFor($routeName, array $params = array())
    {
        $storageKey = md5($routeName . serialize($params));
        if (array_key_exists($storageKey, $this->resolvedUrls)) {
            return $this->resolvedUrls[$storageKey];
        }

        if (!array_key_exists($routeName, $this->routes)) {
            $this->resolvedUrls[$storageKey] = $routeName;
            return $routeName;
        }

        $route = $this->isValidRoute($this->routes[$routeName]);
        if (!$route) {
            $this->resolvedUrls[$storageKey] = $routeName;
            return $routeName;
        }

        $path = $route['path'];
        if (empty($params)) {
            $this->resolvedUrls[$storageKey] = $path;
            return $path;
        }

        foreach ($params as $key => $value) {
            if (is_string($value) || is_int($value)) {
                $path = str_replace('{' . $key . '}', $value, $path);
            }
        }

        $this->resolvedUrls[$storageKey] = $path;

        return $path;
    }
886862
public static function getParamFromLink($url, $paramName)
    {
        if (!$url) {
            throw new \InvalidArgumentException('url');
        }

        if (!$paramName) {
            throw new \InvalidArgumentException('paramName');
        }

        $parts = parse_url(html_entity_decode($url));
        if (isset($parts)) {
            parse_str($parts['query'], $query);
            if (array_key_exists($paramName, $query)) {
                return $query[$paramName];
            }
        }

        return null;
    }
136802
private function getRoute(string $routeName): Route
    {
        foreach ($this->router->getRouteCollection() as $name => $route) {
            if ($routeName === $name) {
                return $route;
            }
        }

        throw new RuntimeException(sprintf('The route "%s" does not exist.', $routeName));
    }
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;
    }
674185
public function getPageName($routeName)
    {
        if (isset($this->routePageMap[$routeName])) {
            return $this->routePageMap[$routeName];
        }

        throw new NotFoundRouteNameException(sprintf('Not found route with name \'%s\'', $routeName));
    }
1131822
public function url($name, $params = array())
	{
		if ( ! array_key_exists($name, $this->routes))
		{
			throw new \UnexpectedValueException("A route with the name {$name} was not found");
		}

		$route = $this->routes[$name];
		return $route->url($params);
	}
745621
public function assemble($routeName, array $params = [], array $options = [])
    {
        $nameParts  = explode('/', $routeName, 2);
        $parentName = $nameParts[0];
        $childName  = isset($nameParts[1]) ? $nameParts[1] : null;

        $assemblyResult = $this->routeCollection->get($parentName)->assemble($params, $childName);
        $assemblyResult->path = $this->baseUri['path'] . $assemblyResult->path;

        if (isset($options['query'])) {
            $assemblyResult->query = $options['query'];
        }

        if (isset($options['fragment'])) {
            $assemblyResult->fragment = $options['fragment'];
        }

        return $assemblyResult->generateUri(
            $this->baseUri['scheme'],
            $this->baseUri['host'],
            $this->baseUri['port'],
            (isset($options['enforce_absolute_uri']) && $options['enforce_absolute_uri'])
        );
    }
30530
public function findRouteByName($routeName) {
        $routePath = array_search($routeName, $this->routeNames);
        list($method, $index) = explode(':', $routePath);

        return $this->routes[$method][$index];
    }
233543
public function getRoute($actionName)
    {
        if (array_key_exists($actionName, $this->routes)){
            return $this->routes[$actionName];
        }
        return false;
    }
1183165
public function getQuery(string $alias, array $params = []): string
    {
        return self::$routerInstance->getQuery($alias, $params);
    }
548354
protected function get(string $pathName, array $params = [], $headers = []): \Generator
    {
        $url = $this->buildUrl($pathName, $params);

        return $this->httpClient->request('GET', $url, $headers, null, [
            'timeout' => 60
        ]);
    }
1134569
public function getUri($params = array())
    {
        $uri = $this->route;

        if (!empty($params)) {
            $uri = str_replace(array_keys($params), $params, $this->route);
        }

        return $uri;
    }
661411
protected function get_url( $url, $params ) {
		if ( empty( $params ) ) {
			return $url;
		}
		$q = strpos( $url, '?' ) !== false ? '&' : '?';

		return $url . $q . http_build_query( $params );
	}
790707
public function url($params = [], $routeName = null, $queryParams = [], $qsAppend = false)
        {
            $urlBase = $this->config('url.root', '');

            // HTTPS Secure URL?
            $isSecure = false;

            if (isset($params['secure']) && true === $params['secure']) {
                $isSecure = true;
                $urlBase = str_replace('http:', 'https:', $urlBase);
                unset($params['secure']);
            }

            // Detemine what URL is from param types
            if (is_string($params)) {
                $routeName = $params;
                $params = [];
            } elseif (!Arrays::is($params)) {
                throw new Exception("First parameter of URL must be array or string route name");
            }


            // Is there query string data?
            $queryString = "";
            $request = $this->request();

            if (true === $qsAppend && $request->query()) {
                $queryParams = array_merge($request->query(), $queryParams);
            }

            if (count($queryParams) > 0) {
                // Build query string from array $qsData
                $queryString = http_build_query($queryParams, '', '&amp;');
            } else {
                $queryString = false;
            }

            // Get URL from router object by reverse match
            $url = str_replace('%2f', '/', strtolower($this->router()->url($params, $routeName)));

            // Use query string if URL rewriting is not enabled
            if ($this->config('url.rewrite')) {
                $url = $urlBase . $url . (($queryString !== false) ? '?' . $queryString : '');
            } else {
                $url = $urlBase . '?u=' . $url . (($queryString !== false) ? '&amp;' . $queryString : '');
            }

            // Return fully assembled URL
            $url = str_replace('///', '/', $url);

            return $url;
        }
690475
protected function redirectToRefererOrRoute(
        string $routeName,
        array $routeParameters = []
    ): RedirectResponse {
        try {
            return $this->redirectToReferer();
        } catch (CannotRedirectToEmptyRefererUrlException $exception) {
            return $this->redirectToRoute($routeName, $routeParameters);
        }
    }
53158
public function getUrl($params): string
    {
        // prepare params
        $params = $this->getParams($params);

        // retrieve URL
        return Router::getUrl(
            $this->getModule(),
            $this->getController(),
            $params
        );
    }
144189
public function url($route, $params)
    {
        // use array filter to remove keys with null values
        $params += array_filter($this->getEmbedParams());

        return $this->router->generate($route, $params);
    }