UrlGenerator
interface UrlGenerator (View source)
Methods
string | current() Get the current URL for the request. | |
string | previous(mixed $fallback = false) Get the URL for the previous request. | |
string | to(string $path, mixed $extra = [], bool|null $secure = null) Generate an absolute URL to the given path. | |
string | secure(string $path, array $parameters = []) Generate a secure, absolute URL to the given path. | |
string | asset(string $path, bool|null $secure = null) Generate the URL to an application asset. | |
string | route(string $name, mixed $parameters = [], bool $absolute = true) Get the URL to a named route. | |
string | action(string|array $action, mixed $parameters = [], bool $absolute = true) Get the URL to a controller action. | |
$this | setRootControllerNamespace(string $rootNamespace) Set the root controller namespace. |
Details
string current()
Get the current URL for the request.
string previous(mixed $fallback = false)
Get the URL for the previous request.
string to(string $path, mixed $extra = [], bool|null $secure = null)
Generate an absolute URL to the given path.
string secure(string $path, array $parameters = [])
Generate a secure, absolute URL to the given path.
string asset(string $path, bool|null $secure = null)
Generate the URL to an application asset.
string route(string $name, mixed $parameters = [], bool $absolute = true)
Get the URL to a named route.
string action(string|array $action, mixed $parameters = [], bool $absolute = true)
Get the URL to a controller action.
$this setRootControllerNamespace(string $rootNamespace)
Set the root controller namespace.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/7.x/Illuminate/Contracts/Routing/UrlGenerator.html