RouteUrlGenerator
class RouteUrlGenerator (View source)
Properties
protected UrlGenerator | $url | The URL generator instance. | |
protected Request | $request | The request instance. | |
array | $defaultParameters | The named parameter defaults. | |
array | $dontEncode | Characters that should not be URL encoded. |
Methods
void | __construct(UrlGenerator $url, Request $request) Create a new Route URL generator. | |
string | to(Route $route, array $parameters = [], bool $absolute = false) Generate a URL for the given route. | |
string | getRouteDomain(Route $route, array $parameters) Get the formatted domain for a given route. | |
string | formatDomain(Route $route, array $parameters) Format the domain and port for the route and request. | |
string | getRouteScheme(Route $route) Get the scheme for the given route. | |
string | addPortToDomain(string $domain) Add the port to the domain if necessary. | |
string | replaceRootParameters(Route $route, string $domain, array $parameters) Replace the parameters on the root path. | |
string | replaceRouteParameters(string $path, array $parameters) Replace all of the wildcard parameters for a route path. | |
string | replaceNamedParameters(string $path, array $parameters) Replace all of the named parameters in the path. | |
mixed|string | addQueryString(string $uri, array $parameters) Add a query string to the URI. | |
string | getRouteQueryString(array $parameters) Get the query string for a given route. | |
array | getStringParameters(array $parameters) Get the string parameters from a given list. | |
array | getNumericParameters(array $parameters) Get the numeric parameters from a given list. | |
void | defaults(array $defaults) Set the default named parameters used by the URL generator. |
Details
void __construct(UrlGenerator $url, Request $request)
Create a new Route URL generator.
string to(Route $route, array $parameters = [], bool $absolute = false)
Generate a URL for the given route.
protected string getRouteDomain(Route $route, array $parameters)
Get the formatted domain for a given route.
protected string formatDomain(Route $route, array $parameters)
Format the domain and port for the route and request.
protected string getRouteScheme(Route $route)
Get the scheme for the given route.
protected string addPortToDomain(string $domain)
Add the port to the domain if necessary.
protected string replaceRootParameters(Route $route, string $domain, array $parameters)
Replace the parameters on the root path.
protected string replaceRouteParameters(string $path, array $parameters)
Replace all of the wildcard parameters for a route path.
protected string replaceNamedParameters(string $path, array $parameters)
Replace all of the named parameters in the path.
protected mixed|string addQueryString(string $uri, array $parameters)
Add a query string to the URI.
protected string getRouteQueryString(array $parameters)
Get the query string for a given route.
protected array getStringParameters(array $parameters)
Get the string parameters from a given list.
protected array getNumericParameters(array $parameters)
Get the numeric parameters from a given list.
void defaults(array $defaults)
Set the default named parameters used by the URL generator.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/7.x/Illuminate/Routing/RouteUrlGenerator.html