Get the URL to a named route.

@param  string  $name
@param  mixed   $parameters
@param  bool  $absolute
@param  \Illuminate\Routing\Route  $route
@return string

@throws \InvalidArgumentException
973415
public function route($name, $parameters = array(), $absolute = true, $route = null)
    {
        if($path = $this->getPathFinder()->toRouteName($name, $parameters)){
            if($absolute){
                return $this->to($path);
            }
            return $path;
        }

        return parent::route($name, $parameters, $absolute, $route);
    }
408652
protected function  generateUrl($route,array $parameters){
        return $this->container->get('router')->generate($route, $parameters, Router::ABSOLUTE_URL);
    }
801477
public function redirectRoute($route, $parameters = [], $absolute = true)
    {
        $this->url = route($route, $parameters, $absolute);

        return $this;
    }
444271
public function getPath($name, array $parameters = array())
    {
        return $this->container->get('router.url_generator')->generate($name, $parameters, false);
    }
757913
public function route(string $name, array $parameters = [], bool $absolute = true): self
    {
        $this->route = route($name, $parameters, $absolute);

        $this->active([$this->route, $this->route.'/*']);

        return $this;
    }
188558
public function buildUrl($name, $parameters=array(), $baseUrl=null)
	{
		$url = $this->routeByName($name)->interpolate($parameters);

		if($baseUrl)
			return (string) $baseUrl->relative($url);
		else if(isset($this->_baseUrl))
			return $this->_baseUrl->relative($url);
		else
			return $url;
	}
172209
public function temporarySignedRoute($name, $expiration, $parameters = [], $absolute = true)
    {
        return $this->signedRoute($name, $parameters, $expiration, $absolute);
    }
544900
public function route($name, $parameters = [], $secure = null)
    {
        if (! isset($this->app->router->namedRoutes[$name])) {
            throw new \InvalidArgumentException("Route [{$name}] not defined.");
        }

        $uri = $this->app->router->namedRoutes[$name];

        $parameters = $this->formatParameters($parameters);

        $uri = \preg_replace_callback('/\[([^\]]*)\]$/', function ($matches) use ($uri, &$parameters) {
            $uri = $this->replaceRouteParameters($matches[1], $parameters);

            return ($matches[1] == $uri) ? '' : $uri;
        }, $uri);

        $uri = $this->replaceRouteParameters($uri, $parameters);

        $uri = $this->to($uri, [], $secure);

        if (! empty($parameters)) {
            $uri .= '?'.\http_build_query($parameters);
        }

        return $uri;
    }
1151581
public function getUrl($name, array $parameters = array())
    {
        return $this->container->get('router.url_generator')->generate($name, $parameters, true);
    }
1077501
public function linkRoute($route, $name, $parameters=array(), $position="BL", $attributes=array())
    {
        return $this->link(route($route, $parameters), $name, $position, $attributes);
    }
334949
public function getOptions($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(
                    sprintf(
                        'The sitemap option must be of type "boolean" or "array", got "%s"',
                        $option
                    )
                );
            }

            $option = $bool;
        }

        if (!$option) {
            return null;
        }

        $options = [
            'lastmod' => null,
            'changefreq' => null,
            'priority' => null,
        ];
        if (is_array($option)) {
            $options = array_merge($options, $option);
        }

        if (is_string($options['lastmod'])) {
            try {
                $options['lastmod'] = new \DateTime($options['lastmod']);
            } catch (\Exception $e) {
                throw new \InvalidArgumentException(
                    sprintf(
                        'The route %s has an invalid value "%s" specified for the "lastmod" option',
                        $name,
                        $options['lastmod']
                    ),
                    0,
                    $e
                );
            }
        }

        return $options;
    }
1279140
public function getUrl($name, $parameters = array(), $relative = false)
	{
		return $this->urlGenerator->getRouteUrl($name, $parameters, $relative);
	}
1207543
protected function toRoute($route, array $parameters, $absolute)
    {
        $domain = $this->getRouteDomain($route, $parameters);

        $root = $this->replaceRoot($route, $domain, $parameters);

        $uri = strtr(rawurlencode($this->trimUrl(
            $root, $this->replaceRouteParameters($route->uri(), $parameters)

        )), $this->dontEncode) .$this->getRouteQueryString($parameters);

        return $absolute ? $uri : '/' .ltrim(str_replace($root, '', $uri), '/');
    }
578931
protected function getUrlConcrete($name, $options)
    {
        try {
            return new UrlConcrete(
                $this->getRouteUri($name),
                $options['lastmod'],
                $options['changefreq'],
                $options['priority']
            );
        } catch (\Exception $e) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Invalid argument for route "%s": %s',
                    $name,
                    $e->getMessage()
                ),
                0,
                $e
            );
        }
    }
1102556
public function build(Route $route, $name, array $parameters = [])
    {
        $url      = $this->app['url_generator']->generate($name, $parameters, UrlGeneratorInterface::ABSOLUTE_URL);
        $request  = Request::create($url, 'GET', array_merge(['_format' => $route->getFormat()], $parameters));
        $response = $this->app->handle($request);

        $this->write(
            $this->getFilePath($route, $parameters),
            $response->getContent(),
            $request->getFormat($response->headers->get('Content-Type')),
            $route->getFileName()
        );
    }
735487
public function apiRoute($name, $parameters = [], $absolute = true)
    {
        return app('url')->route($this->prefixApiRoute($name), $parameters, $absolute);
    }
1049904
public function routeModel( $name, $model, $parameters = [], $absolute = true )
	{
		if ( !$model instanceof RoutableModel )
			throw new UrlGenerationException( "The model [" . get_class( $model ) . "] must implement the RoutableModel interface." );

		if ( !is_null( $route = $this->routes->getByName( $name ) ) )
		{
			$appendedUrl = "";

			if ( is_array( $p = $model->appendRoute( $name, $parameters, $appendedUrl ) ) )
				$parameters = array_merge( $parameters, $p );

			return $this->toRoute( $route, $parameters, $absolute ) . $appendedUrl;
		}

		throw new RouteNotFoundException( "Route [{$name}] not found." );
	}