class Route

Traits

Constants

private PARAMS_CONTEXT_KEY_PREFIX

Context key for coroutine-local route parameters.

Route objects are cached and shared across coroutines, so per-request mutable state (parameters, controller instances) must be stored in coroutine-local Context rather than on the Route instance.

private ORIGINAL_PARAMS_CONTEXT_KEY_PREFIX

Context key for coroutine-local original route parameters.

private CONTROLLER_CONTEXT_KEY_PREFIX

Context key prefix for coroutine-local controller instances.

Properties

static protected array $macros

The registered string macros.

from  Macroable
static protected array<string, bool> $enumCache

Cached isEnum results keyed by class name.

from  ResolvesRouteDependencies
string $uri

The URI pattern the route responds to.

array $methods

The HTTP methods the route responds to.

array $action

The route action array.

bool $isFallback

Indicates whether the route is a fallback route.

array $defaults

The default values for the route.

array $wheres

The regular expression requirements.

array|null $parameterNames

The parameter names for the route.

protected bool $withTrashedBindings

Indicates "trashed" models can be retrieved when resolving implicit model bindings for this route.

protected int|null $lockSeconds

Indicates the maximum number of seconds the route should acquire a session lock for.

protected int|null $waitSeconds

Indicates the maximum number of seconds the route should wait while attempting to acquire a session lock.

array|null $computedMiddleware

The computed gathered middleware.

array|null $resolvedMiddleware

The cached resolved middleware with class names expanded and groups resolved.

null|array<int, mixed> $middlewareDescriptors

The cached pipeline descriptors for resolved class-string middleware.

null|array<int, mixed> $pipelineMiddleware

The gathered middleware list the compiled pipeline was built from.

Closure|null $middlewarePipeline

The reusable route middleware pipeline.

CompiledRoute|null $compiled

The compiled version of the route.

protected object|null $callable

The resolved callable for the route.

protected Closure|null $missing

The resolved missing model handler for the route.

protected CallableDispatcher|null $callableDispatcher

The cached callable dispatcher instance.

protected mixed $controller

The cached controller instance for worker-shared (singleton) controllers.

protected ControllerDispatcher|null $controllerDispatcher

The cached controller dispatcher instance.

protected Router|null $router

The router instance used by the route.

protected Container|null $container

The container instance used by the route.

protected array $bindingFields

The fields that implicit binding should use for a given parameter.

static null|ValidatorInterface> $validators

The validators used by the routes.

Methods

mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

whereAlpha(array|string $parameters)

Specify that the given route parameters must be alphabetic.

whereAlphaNumeric(array|string $parameters)

Specify that the given route parameters must be alphanumeric.

whereNumber(array|string $parameters)

Specify that the given route parameters must be numeric.

whereUlid(array|string $parameters)

Specify that the given route parameters must be ULIDs.

whereUuid(array|string $parameters)

Specify that the given route parameters must be UUIDs.

whereIn(array|string $parameters, array $values)

Specify that the given route parameters must be one of the given values.

assignExpressionToParameters(array|string $parameters, string $expression)

Apply the given regular expression to the given parameters.

static bool
methodExcludedByOptions(string $method, array $options)

Determine if the given options exclude a particular method.

static void
macro(string $name, callable|object $macro)

Register a custom macro.

static void
mixin(object $mixin, bool $replace = true)

Mix another object into the class.

static bool
hasMacro(string $name)

Check if macro is registered.

static void
flushMacros()

Flush the existing macros.

static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

mixed
__call(string $method, array $parameters)

Dynamically handle calls to the class.

static void
flushEnumCache()

Flush the static enum cache.

array
resolveClassMethodDependencies(array $parameters, object $instance, string $method)

Resolve the object method's type-hinted dependencies.

array
resolveMethodDependencies(array $parameters, array $reflectedParameters)

Resolve the given method's type-hinted dependencies.

mixed
transformDependency(ReflectionParameter $parameter, array $parameters, object $skippableValue)

Attempt to transform the given parameter into a class instance.

bool
alreadyInParameters(string $class, array $parameters)

Determine if an object of the given class is in a list of parameters.

void
spliceIntoParameters(array $parameters, int $offset, mixed $value)

Splice the given value into the parameter list.

__construct(array|string $methods, string $uri, callable|array|null $action)

Create a new Route instance.

array
parseAction(callable|array|null $action)

Parse the route action into a standard array.

mixed
run()

Run the route action and return the response.

bool
isControllerAction()

Check whether the route's action is a controller.

mixed
runCallable()

Run the callable route action and return the response.

callableDispatcher()

Get the callable dispatcher for the route.

bool
isSerializedClosure()

Determine if the route action is a serialized Closure.

mixed
runController()

Run the controller route action and return the response.

mixed
getController()

Get the controller instance for the route.

string|null
getControllerClass()

Get the controller class used for the route.

string
getControllerMethod()

Get the controller method used for the route.

array
parseControllerCallback()

Parse the controller.

void
flushController()

Flush the cached controller state on the route.

bool
matches(Request $request, bool $includingMethod = true)

Determine if the route matches a given request.

CompiledRoute
compileRoute()

Compile the route into a Symfony CompiledRoute instance.

void
ensureCompiled()

Ensure the route is compiled.

bind(Request $request)

Bind the route to a given request for execution.

bindFromCompiledMatch(array $parameters, Request $request)

Bind parameters returned by the compiled route matcher.

bool
hasParameters()

Determine if the route has parameters.

bool
hasParameter(string $name)

Determine if a given parameter exists on the route.

mixed
parameter(string $name, mixed $default = null)

Get a given parameter from the route.

string|null
originalParameter(string $name, string|null $default = null)

Get original value of a given parameter from the route.

void
setParameter(string $name, mixed $value)

Set a parameter to the given value.

void
forgetParameter(string $name)

Unset a parameter on the route if it is set.

array
parameters()

Get the key / value list of parameters for the route.

array
originalParameters()

Get the key / value list of original parameters for the route.

array
parametersWithoutNulls()

Get the key / value list of parameters without null values.

array
parameterNames()

Get all of the parameter names for the route.

array
compileParameterNames()

Get the parameter names for the route.

array
signatureParameters(array|string $conditions = [])

Get the parameters that are listed in the route / controller signature.

string|null
bindingFieldFor(string|int $parameter)

Get the binding field for the given parameter.

array
bindingFields()

Get the binding fields for the route.

setBindingFields(array $bindingFields)

Set the binding fields for the route.

mixed
parentOfParameter(string $parameter)

Get the parent parameter of the given parameter.

withTrashed(bool $withTrashed = true)

Allow "trashed" models to be retrieved when resolving implicit model bindings for this route.

bool
allowsTrashedBindings()

Determine if the route allows "trashed" models to be retrieved when resolving implicit model bindings.

defaults(string $key, mixed $value)

Set a default value for the route.

setDefaults(array $defaults)

Set the default values for the route.

where(array|string $name, string|null $expression = null)

Set a regular expression requirement on the route.

array
parseWhere(array|string $name, string|null $expression)

Parse arguments to the where method into an array.

setWheres(array $wheres)

Set a list of regular expression requirements on the route.

fallback()

Mark this route as a fallback route.

setFallback(bool $isFallback)

Set the fallback value.

array
methods()

Get the HTTP verbs the route responds to.

bool
httpOnly()

Determine if the route only responds to HTTP requests.

bool
httpsOnly()

Determine if the route only responds to HTTPS requests.

bool
secure()

Determine if the route only responds to HTTPS requests.

Route|string|null
domain(BackedEnum|string|null $domain = null)

Get or set the domain for the route.

string|null
getDomain()

Get the domain defined for the route.

Route|int|null
port(int|null $port = null)

Get or set the port for the route.

int|null
getPort()

Get the port defined for the route.

string|null
getPrefix()

Get the prefix of the route instance.

prefix(string|null $prefix)

Add a prefix to the route URI.

void
updatePrefixOnAction(string $prefix)

Update the "prefix" attribute on the action array.

string
uri()

Get the URI associated with the route.

setUri(string $uri)

Set the URI that the route responds to.

string
parseUri(string $uri)

Parse the route URI and normalize / store any implicit binding fields.

string|null
getName()

Get the name of the route instance.

name(BackedEnum|string $name)

Add or change the route name.

bool
named(mixed ...$patterns)

Determine whether the route's name matches the given patterns.

uses(Closure|array|string $action)

Set the handler for the route.

string
addGroupNamespaceToStringUses(string $action)

Parse a string based action for the "uses" fluent method.

string
getActionName()

Get the action name for the route.

string
getActionMethod()

Get the method name of the route action.

mixed
getAction(string|null $key = null)

Get the action array or one of its properties for the route.

setAction(array $action)

Set the action array for the route.

Closure|null
getMissing()

Get the value of the action that should be taken on a missing model exception.

missing(Closure $missing)

Define the callable that should be invoked on a missing model exception.

array
gatherMiddleware()

Get all middleware, including the ones from the controller.

Route|array
middleware(array|string|Stringable|null $middleware = null)

Get or set the middlewares attached to the route.

can(UnitEnum|string $ability, array|string $models = [])

Specify that the "Authorize" / "can" middleware should be applied to the route.

array
controllerMiddleware()

Get the middleware for the route's controller.

array
staticallyProvidedControllerMiddleware(string $class, string $method)

Get the statically provided controller middleware for the given class and method.

array
attributeProvidedControllerMiddleware(string $class, string $method)

Get the attribute provided controller middleware for the given class and method.

array
excludedControllerMiddleware()

Get the excluded middleware for the route's controller.

array
attributeProvidedControllerMiddlewareExclusions(string $class, string $method)

Get the attribute provided excluded controller middleware for the given class and method.

withoutMiddleware(array|string $middleware)

Specify middleware that should be removed from the given route.

array
excludedMiddleware()

Get the middleware that should be removed from the route.

scopeBindings()

Indicate that the route should enforce scoping of multiple implicit Eloquent bindings.

withoutScopedBindings()

Indicate that the route should not enforce scoping of multiple implicit Eloquent bindings.

bool
enforcesScopedBindings()

Determine if the route should enforce scoping of multiple implicit Eloquent bindings.

bool
preventsScopedBindings()

Determine if the route should prevent scoping of multiple implicit Eloquent bindings.

block(int|null $lockSeconds = 10, int|null $waitSeconds = 10)

Specify that the route should not allow concurrent requests from the same session.

withoutBlocking()

Specify that the route should allow concurrent requests from the same session.

int|null
locksFor()

Get the maximum number of seconds the route's session lock should be held for.

int|null
waitsFor()

Get the maximum number of seconds to wait while attempting to acquire a session lock.

metadata(array $metadata)

Add metadata to the route.

mixed
getMetadata(string|null $key = null, mixed $default = null)

Get metadata for the route.

setMetadata(array $metadata)

Set the metadata for the route, replacing any existing metadata.

controllerDispatcher()

Get the dispatcher for the route's controller.

static array
getValidators()

Get the route validators for the instance.

Route
toSymfonyRoute()

Convert the route to a Symfony route.

array
getOptionalParameterNames()

Get the optional parameter names for the route.

CompiledRoute|null
getCompiled()

Get the compiled version of the route.

setRouter(Router $router)

Set the router instance on the route.

setContainer(Container $container)

Set the container instance on the route.

void
prepareForSerialization()

Prepare the route instance for serialization.

static void
flushState()

Flush all static state.

mixed
__get(string $key)

Dynamically access route parameters.

Details

in Conditionable at line 23
mixed when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in Conditionable at line 56
mixed unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

CreatesRegularExpressionRouteConstraints whereAlpha(array|string $parameters)

Specify that the given route parameters must be alphabetic.

Parameters

array|string $parameters

Return Value

CreatesRegularExpressionRouteConstraints

CreatesRegularExpressionRouteConstraints whereAlphaNumeric(array|string $parameters)

Specify that the given route parameters must be alphanumeric.

Parameters

array|string $parameters

Return Value

CreatesRegularExpressionRouteConstraints

CreatesRegularExpressionRouteConstraints whereNumber(array|string $parameters)

Specify that the given route parameters must be numeric.

Parameters

array|string $parameters

Return Value

CreatesRegularExpressionRouteConstraints

CreatesRegularExpressionRouteConstraints whereUlid(array|string $parameters)

Specify that the given route parameters must be ULIDs.

Parameters

array|string $parameters

Return Value

CreatesRegularExpressionRouteConstraints

CreatesRegularExpressionRouteConstraints whereUuid(array|string $parameters)

Specify that the given route parameters must be UUIDs.

Parameters

array|string $parameters

Return Value

CreatesRegularExpressionRouteConstraints

CreatesRegularExpressionRouteConstraints whereIn(array|string $parameters, array $values)

Specify that the given route parameters must be one of the given values.

Parameters

array|string $parameters
array $values

Return Value

CreatesRegularExpressionRouteConstraints

protected CreatesRegularExpressionRouteConstraints assignExpressionToParameters(array|string $parameters, string $expression)

Apply the given regular expression to the given parameters.

Parameters

array|string $parameters
string $expression

Return Value

CreatesRegularExpressionRouteConstraints

static bool methodExcludedByOptions(string $method, array $options)

Determine if the given options exclude a particular method.

Parameters

string $method
array $options

Return Value

bool

in Macroable at line 28
static void macro(string $name, callable|object $macro)

Register a custom macro.

Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.

Parameters

string $name
callable|object $macro

Return Value

void

in Macroable at line 41
static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

in Macroable at line 57
static bool hasMacro(string $name)

Check if macro is registered.

Parameters

string $name

Return Value

bool

in Macroable at line 68
static void flushMacros()

Flush the existing macros.

Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.

Return Value

void

in Macroable at line 78
static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in Macroable at line 103
mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

static void flushEnumCache()

Flush the static enum cache.

Boot or tests only. Clears the process-wide enum lookup cache shared by every coroutine; next resolution re-resolves.

Return Value

void

protected array resolveClassMethodDependencies(array $parameters, object $instance, string $method)

Resolve the object method's type-hinted dependencies.

Parameters

array $parameters
object $instance
string $method

Return Value

array

array resolveMethodDependencies(array $parameters, array $reflectedParameters)

Resolve the given method's type-hinted dependencies.

Parameters

array $parameters
array $reflectedParameters

Return Value

array

protected mixed transformDependency(ReflectionParameter $parameter, array $parameters, object $skippableValue)

Attempt to transform the given parameter into a class instance.

Parameters

ReflectionParameter $parameter
array $parameters
object $skippableValue

Return Value

mixed

protected bool alreadyInParameters(string $class, array $parameters)

Determine if an object of the given class is in a list of parameters.

Parameters

string $class
array $parameters

Return Value

bool

protected void spliceIntoParameters(array $parameters, int $offset, mixed $value)

Splice the given value into the parameter list.

Parameters

array $parameters
int $offset
mixed $value

Return Value

void

at line 235
__construct(array|string $methods, string $uri, callable|array|null $action)

Create a new Route instance.

Parameters

array|string $methods
string $uri
callable|array|null $action

at line 253
protected array parseAction(callable|array|null $action)

Parse the route action into a standard array.

Parameters

callable|array|null $action

Return Value

array

Exceptions

UnexpectedValueException

at line 261
mixed run()

Run the route action and return the response.

Return Value

mixed

at line 279
protected bool isControllerAction()

Check whether the route's action is a controller.

Return Value

bool

at line 287
protected mixed runCallable()

Run the callable route action and return the response.

Return Value

mixed

at line 307
protected CallableDispatcher callableDispatcher()

Get the callable dispatcher for the route.

Return Value

CallableDispatcher

at line 315
protected bool isSerializedClosure()

Determine if the route action is a serialized Closure.

Return Value

bool

at line 325
protected mixed runController()

Run the controller route action and return the response.

Return Value

mixed

Exceptions

NotFoundHttpException

at line 347
mixed getController()

Get the controller instance for the route.

For worker-shared controllers (singletons and unbound auto-singletons), the instance is cached directly on the Route property for zero-overhead access across coroutines.

For controllers with per-coroutine semantics (#[Scoped] or explicit bind()), the instance is stored in coroutine Context to preserve the container's binding contract. CoroutineContext::getOrSet memoizes within a coroutine (getController() is called twice — middleware + dispatch) while still giving each coroutine its own instance.

Return Value

mixed

at line 392
string|null getControllerClass()

Get the controller class used for the route.

Return Value

string|null

at line 400
protected string getControllerMethod()

Get the controller method used for the route.

Return Value

string

at line 408
protected array parseControllerCallback()

Parse the controller.

Return Value

array

at line 423
void flushController()

Flush the cached controller state on the route.

Boot or tests only. Clears caches on the worker-shared route and evicts its controller class from the container.

Clears both the route-level property cache (for worker-shared controllers) and the coroutine Context entry (for scoped/bound controllers), plus the container's auto-singleton cache so make() creates a fresh instance.

Return Value

void

at line 442
bool matches(Request $request, bool $includingMethod = true)

Determine if the route matches a given request.

Parameters

Request $request
bool $includingMethod

Return Value

bool

at line 465
protected CompiledRoute compileRoute()

Compile the route into a Symfony CompiledRoute instance.

The compiled result is cached on the Route instance for the worker lifetime — it's immutable after compilation and safe to share.

Return Value

CompiledRoute

at line 480
void ensureCompiled()

Ensure the route is compiled.

Called during server boot pre-warming to populate the compiled regex cache before fork, so workers inherit it via copy-on-write.

Return Value

void

at line 508
Route bind(Request $request)

Bind the route to a given request for execution.

Parameters are stored in coroutine Context, not on the Route instance, because Route objects are cached and shared across coroutines.

Parameters

Request $request

Return Value

Route

at line 524
Route bindFromCompiledMatch(array $parameters, Request $request)

internal  
 

Bind parameters returned by the compiled route matcher.

Parameters

array $parameters
Request $request

Return Value

Route

at line 561
bool hasParameters()

Determine if the route has parameters.

Return Value

bool

at line 569
bool hasParameter(string $name)

Determine if a given parameter exists on the route.

Parameters

string $name

Return Value

bool

at line 581
mixed parameter(string $name, mixed $default = null)

Get a given parameter from the route.

Parameters

string $name
mixed $default

Return Value

mixed

at line 589
string|null originalParameter(string $name, string|null $default = null)

Get original value of a given parameter from the route.

Parameters

string $name
string|null $default

Return Value

string|null

at line 597
void setParameter(string $name, mixed $value)

Set a parameter to the given value.

Parameters

string $name
mixed $value

Return Value

void

at line 609
void forgetParameter(string $name)

Unset a parameter on the route if it is set.

Parameters

string $name

Return Value

void

at line 623
array parameters()

Get the key / value list of parameters for the route.

Return Value

array

Exceptions

LogicException

at line 639
array originalParameters()

Get the key / value list of original parameters for the route.

Return Value

array

Exceptions

LogicException

at line 653
array parametersWithoutNulls()

Get the key / value list of parameters without null values.

Return Value

array

at line 665
array parameterNames()

Get all of the parameter names for the route.

Return Value

array

at line 673
protected array compileParameterNames()

Get the parameter names for the route.

Return Value

array

at line 683
array signatureParameters(array|string $conditions = [])

Get the parameters that are listed in the route / controller signature.

Parameters

array|string $conditions

Return Value

array

at line 695
string|null bindingFieldFor(string|int $parameter)

Get the binding field for the given parameter.

Parameters

string|int $parameter

Return Value

string|null

at line 705
array bindingFields()

Get the binding fields for the route.

Return Value

array

at line 713
Route setBindingFields(array $bindingFields)

Set the binding fields for the route.

Parameters

array $bindingFields

Return Value

Route

at line 723
mixed parentOfParameter(string $parameter)

Get the parent parameter of the given parameter.

Parameters

string $parameter

Return Value

mixed

at line 738
Route withTrashed(bool $withTrashed = true)

Allow "trashed" models to be retrieved when resolving implicit model bindings for this route.

Parameters

bool $withTrashed

Return Value

Route

at line 748
bool allowsTrashedBindings()

Determine if the route allows "trashed" models to be retrieved when resolving implicit model bindings.

Return Value

bool

at line 756
Route defaults(string $key, mixed $value)

Set a default value for the route.

Parameters

string $key
mixed $value

Return Value

Route

at line 766
Route setDefaults(array $defaults)

Set the default values for the route.

Parameters

array $defaults

Return Value

Route

at line 776
Route where(array|string $name, string|null $expression = null)

Set a regular expression requirement on the route.

Parameters

array|string $name
string|null $expression

Return Value

Route

at line 788
protected array parseWhere(array|string $name, string|null $expression)

Parse arguments to the where method into an array.

Parameters

array|string $name
string|null $expression

Return Value

array

at line 796
Route setWheres(array $wheres)

Set a list of regular expression requirements on the route.

Parameters

array $wheres

Return Value

Route

at line 808
Route fallback()

Mark this route as a fallback route.

Return Value

Route

at line 818
Route setFallback(bool $isFallback)

Set the fallback value.

Parameters

bool $isFallback

Return Value

Route

at line 828
array methods()

Get the HTTP verbs the route responds to.

Return Value

array

at line 836
bool httpOnly()

Determine if the route only responds to HTTP requests.

Return Value

bool

at line 844
bool httpsOnly()

Determine if the route only responds to HTTPS requests.

Return Value

bool

at line 852
bool secure()

Determine if the route only responds to HTTPS requests.

Return Value

bool

at line 864
Route|string|null domain(BackedEnum|string|null $domain = null)

Get or set the domain for the route.

Parameters

BackedEnum|string|null $domain

Return Value

Route|string|null

Exceptions

InvalidArgumentException

at line 889
string|null getDomain()

Get the domain defined for the route.

Return Value

string|null

at line 899
Route|int|null port(int|null $port = null)

Get or set the port for the route.

Parameters

int|null $port

Return Value

Route|int|null

at line 913
int|null getPort()

Get the port defined for the route.

Return Value

int|null

at line 921
string|null getPrefix()

Get the prefix of the route instance.

Return Value

string|null

at line 929
Route prefix(string|null $prefix)

Add a prefix to the route URI.

Parameters

string|null $prefix

Return Value

Route

at line 943
protected void updatePrefixOnAction(string $prefix)

Update the "prefix" attribute on the action array.

Parameters

string $prefix

Return Value

void

at line 953
string uri()

Get the URI associated with the route.

Return Value

string

at line 961
Route setUri(string $uri)

Set the URI that the route responds to.

Parameters

string $uri

Return Value

Route

at line 971
protected string parseUri(string $uri)

Parse the route URI and normalize / store any implicit binding fields.

Parameters

string $uri

Return Value

string

at line 983
string|null getName()

Get the name of the route instance.

Return Value

string|null

at line 993
Route name(BackedEnum|string $name)

Add or change the route name.

Parameters

BackedEnum|string $name

Return Value

Route

Exceptions

InvalidArgumentException

at line 1007
bool named(mixed ...$patterns)

Determine whether the route's name matches the given patterns.

Parameters

mixed ...$patterns

Return Value

bool

at line 1026
Route uses(Closure|array|string $action)

Set the handler for the route.

Parameters

Closure|array|string $action

Return Value

Route

at line 1043
protected string addGroupNamespaceToStringUses(string $action)

Parse a string based action for the "uses" fluent method.

Parameters

string $action

Return Value

string

at line 1057
string getActionName()

Get the action name for the route.

Return Value

string

at line 1065
string getActionMethod()

Get the method name of the route action.

Return Value

string

at line 1073
mixed getAction(string|null $key = null)

Get the action array or one of its properties for the route.

Parameters

string|null $key

Return Value

mixed

at line 1081
Route setAction(array $action)

Set the action array for the route.

Parameters

array $action

Return Value

Route

at line 1103
Closure|null getMissing()

Get the value of the action that should be taken on a missing model exception.

Return Value

Closure|null

at line 1131
Route missing(Closure $missing)

Define the callable that should be invoked on a missing model exception.

Parameters

Closure $missing

Return Value

Route

at line 1142
array gatherMiddleware()

Get all middleware, including the ones from the controller.

Return Value

array

at line 1161
Route|array middleware(array|string|Stringable|null $middleware = null)

Get or set the middlewares attached to the route.

Parameters

array|string|Stringable|null $middleware

Return Value

Route|array

at line 1186
Route can(UnitEnum|string $ability, array|string $models = [])

Specify that the "Authorize" / "can" middleware should be applied to the route.

Parameters

UnitEnum|string $ability
array|string $models

Return Value

Route

at line 1198
array controllerMiddleware()

Get the middleware for the route's controller.

Return Value

array

at line 1227
protected array staticallyProvidedControllerMiddleware(string $class, string $method)

Get the statically provided controller middleware for the given class and method.

Parameters

string $class
string $method

Return Value

array

at line 1251
protected array attributeProvidedControllerMiddleware(string $class, string $method)

Get the attribute provided controller middleware for the given class and method.

Parameters

string $class
string $method

Return Value

array

at line 1296
array excludedControllerMiddleware()

Get the excluded middleware for the route's controller.

Return Value

array

at line 1313
protected array attributeProvidedControllerMiddlewareExclusions(string $class, string $method)

Get the attribute provided excluded controller middleware for the given class and method.

Parameters

string $class
string $method

Return Value

array

at line 1357
Route withoutMiddleware(array|string $middleware)

Specify middleware that should be removed from the given route.

Parameters

array|string $middleware

Return Value

Route

at line 1370
array excludedMiddleware()

Get the middleware that should be removed from the route.

Return Value

array

at line 1381
Route scopeBindings()

Indicate that the route should enforce scoping of multiple implicit Eloquent bindings.

Return Value

Route

at line 1391
Route withoutScopedBindings()

Indicate that the route should not enforce scoping of multiple implicit Eloquent bindings.

Return Value

Route

at line 1401
bool enforcesScopedBindings()

Determine if the route should enforce scoping of multiple implicit Eloquent bindings.

Return Value

bool

at line 1409
bool preventsScopedBindings()

Determine if the route should prevent scoping of multiple implicit Eloquent bindings.

Return Value

bool

at line 1417
Route block(int|null $lockSeconds = 10, int|null $waitSeconds = 10)

Specify that the route should not allow concurrent requests from the same session.

Parameters

int|null $lockSeconds
int|null $waitSeconds

Return Value

Route

at line 1428
Route withoutBlocking()

Specify that the route should allow concurrent requests from the same session.

Return Value

Route

at line 1436
int|null locksFor()

Get the maximum number of seconds the route's session lock should be held for.

Return Value

int|null

at line 1444
int|null waitsFor()

Get the maximum number of seconds to wait while attempting to acquire a session lock.

Return Value

int|null

at line 1452
Route metadata(array $metadata)

Add metadata to the route.

Parameters

array $metadata

Return Value

Route

at line 1467
mixed getMetadata(string|null $key = null, mixed $default = null)

Get metadata for the route.

Parameters

string|null $key
mixed $default

Return Value

mixed

at line 1477
Route setMetadata(array $metadata)

Set the metadata for the route, replacing any existing metadata.

Parameters

array $metadata

Return Value

Route

at line 1487
ControllerDispatcher controllerDispatcher()

Get the dispatcher for the route's controller.

Return Value

ControllerDispatcher

at line 1503
static array getValidators()

Get the route validators for the instance.

Return Value

array

at line 1518
Route toSymfonyRoute()

Convert the route to a Symfony route.

Return Value

Route

at line 1536
array getOptionalParameterNames()

Get the optional parameter names for the route.

Return Value

array

at line 1546
CompiledRoute|null getCompiled()

Get the compiled version of the route.

Return Value

CompiledRoute|null

at line 1554
Route setRouter(Router $router)

Set the router instance on the route.

Parameters

Router $router

Return Value

Route

at line 1564
Route setContainer(Container $container)

Set the container instance on the route.

Parameters

Container $container

Return Value

Route

at line 1594
void prepareForSerialization()

Prepare the route instance for serialization.

Return Value

void

Exceptions

LogicException

at line 1627
static void flushState()

Flush all static state.

Return Value

void

at line 1637
mixed __get(string $key)

Dynamically access route parameters.

Parameters

string $key

Return Value

mixed