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 17
string
current()
Get the current URL for the request.
at line 22
string
previous(bool|string $fallback = false)
Get the URL for the previous request.
at line 27
string
to(string $path, array|string $extra = [], bool|null $secure = null)
Generate an absolute URL to the given path.
at line 32
string
secure(string $path, array $parameters = [])
Generate a secure, absolute URL to the given path.
at line 37
string
asset(string $path, bool|null $secure = null)
Generate the URL to an application asset.
at line 44
string
route(BackedEnum|string $name, mixed $parameters = [], bool $absolute = true)
Get the URL to a named route.
at line 51
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 56
string
temporarySignedRoute(BackedEnum|string $name, DateInterval|DateTimeInterface|int $expiration, array $parameters = [], bool $absolute = true)
Create a temporary signed route URL for a named route.
at line 61
string
query(string $path, array $query = [], array|string $extra = [], bool|null $secure = null)
Generate an absolute URL with the given query parameters.
at line 66
string
action(array|string $action, array|string $parameters = [], bool $absolute = true)
Get the URL to a controller action.
at line 71
string|null
getRootControllerNamespace()
Get the root controller namespace.
at line 78
UrlGenerator
setRootControllerNamespace(string $rootNamespace)
Set the root controller namespace.