Uri
class Uri implements Htmlable, Responsable, Stringable (View source)
Traits
Properties
protected | $uri | The URI instance. |
|
static protected | $urlGeneratorResolver | The URL generator resolver. |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Dump the string representation of the URI.
Call the given Closure with this instance then return the instance.
Create a new parsed URI instance.
Get a URI instance for a named route.
Create a signed route URI instance for a named route.
Create a temporary signed route URI instance for a named route.
Get the URI's scheme.
Get the user from the URI.
Get the password from the URI.
Get the URI's host.
Get the URI's port.
Get the URI's path.
Get the URI's query string.
Get the URI's fragment.
Specify the scheme of the URI.
Specify the user and password for the URI.
Merge new query parameters into the URI if they are not already in the query string.
Push a value onto the end of a query string parameter that is a list.
Remove the given query parameters from the URI.
Specify new query parameters for the URI.
Specify the fragment of the URI.
Create a redirect HTTP response for the given URI.
Get content as a string of HTML.
Get the decoded string representation of the URI.
Get the string representation of the URI.
Determine if the URI is currently an empty string.
Get the underlying URI instance.
Get the string representation of the URI.
Details
$this|TWhenReturnType
when($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
$this|TUnlessReturnType
unless($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
static Uri
route(BackedEnum|string $name, mixed $parameters = [], bool $absolute = true)
Get a URI instance for a named route.
static Uri
signedRoute(BackedEnum|string $name, mixed $parameters = [], DateTimeInterface|DateInterval|int|null $expiration = null, bool $absolute = true)
Create a signed route URI instance for a named route.
static Uri
temporarySignedRoute(BackedEnum|string $name, DateTimeInterface|DateInterval|int $expiration, array $parameters = [], bool $absolute = true)
Create a temporary signed route URI instance for a named route.
Uri
withUser(Stringable|string|null $user, Stringable|string|null $password = null)
Specify the user and password for the URI.
Uri
withQueryIfMissing(array $query)
Merge new query parameters into the URI if they are not already in the query string.
Uri
pushOntoQuery(string $key, mixed $value)
Push a value onto the end of a query string parameter that is a list.
RedirectResponse
redirect(int $status = 302, array $headers = [])
Create a redirect HTTP response for the given URI.