UrlGenerator
interface UrlGenerator
Methods
Get the current URL for the request.
Get the URL for the previous request.
Generate an absolute URL to the given path.
Generate a secure, absolute URL to the given path.
Generate the URL to an application asset.
Get the URL to a named route.
Create a signed route URL for a named route.
Create a temporary signed route URL for a named route.
Generate an absolute URL with the given query parameters.
Get the URL to a controller action.
Get the root controller namespace.
Set the root controller namespace.
Details
at line 18
string
current()
Get the current URL for the request.
at line 23
string
previous(bool|string $fallback = false)
Get the URL for the previous request.
at line 28
string
to(string $path, mixed $extra = [], bool|null $secure = null)
Generate an absolute URL to the given path.
at line 33
string
secure(string $path, mixed $parameters = [])
Generate a secure, absolute URL to the given path.
at line 38
string
asset(string $path, bool|null $secure = null)
Generate the URL to an application asset.
at line 45
string
route(BackedEnum|string $name, mixed $parameters = [], bool $absolute = true)
Get the URL to a named route.
at line 52
string
signedRoute(BackedEnum|string $name, mixed $parameters = [], DateInterval|DateTimeInterface|int|null $expiration = null, bool $absolute = true)
Create a signed route URL for a named route.
at line 57
string
temporarySignedRoute(BackedEnum|string $name, DateInterval|DateTimeInterface|int $expiration, mixed $parameters = [], bool $absolute = true)
Create a temporary signed route URL for a named route.
at line 62
string
query(string $path, array $query = [], mixed $extra = [], bool|null $secure = null)
Generate an absolute URL with the given query parameters.
at line 67
string
action(array|string $action, mixed $parameters = [], bool $absolute = true)
Get the URL to a controller action.
at line 72
string|null
getRootControllerNamespace()
Get the root controller namespace.
at line 79
UrlGenerator
setRootControllerNamespace(string $rootNamespace)
Set the root controller namespace.