Route
Uses
- CreatesRegularExpressionRouteConstraints
- FiltersControllerMiddleware
- Macroable
- ResolvesRouteDependencies
Properties
$uri string
The URI pattern the route responds to.
$methods array
The HTTP methods the route responds to.
$action array
The route action array.
$isFallback bool
Indicates whether the route is a fallback route.
$controller mixed
The controller instance.
$defaults array
The default values for the route.
$wheres array
The regular expression requirements.
$parameters array|null
The array of matched parameters.
$parameterNames array|null
The parameter names for the route.
$originalParameters array
The array of the matched parameters' original values.
$withTrashedBindings bool
Indicates "trashed" models can be retrieved when resolving implicit model bindings for this route.
$lockSeconds int|null
Indicates the maximum number of seconds the route should acquire a session lock for.
$waitSeconds int|null
Indicates the maximum number of seconds the route should wait while attempting to acquire a session lock.
$computedMiddleware array|null
The computed gathered middleware.
$compiled Symfony\...\CompiledRoute
The compiled version of the route.
$bindingFields array
The fields that implicit binding should use for a given parameter.
$validators array
The validators used by the routes.
Methods
__construct ( $methods , $uri , $action ) : void
Create a new Route instance.
Parameters
- $methods array|string
- $uri string
- $action Closure |array
parseAction ( $action ) : array
Parse the route action into a standard array.
Parameters
- $action callable|array|null
run ( ) : mixed
Run the route action and return the response.
isControllerAction ( ) : bool
Checks whether the route's action is a controller.
runCallable ( ) : mixed
Run the route action and return the response.
isSerializedClosure ( ) : bool
Determine if the route action is a serialized Closure.
runController ( ) : mixed
Run the route action and return the response.
getController ( ) : mixed
Get the controller instance for the route.
getControllerClass ( ) : string|null
Get the controller class used for the route.
getControllerMethod ( ) : string
Get the controller method used for the route.
parseControllerCallback ( ) : array
Parse the controller.
flushController ( ) : void
Flush the cached container instance on the route.
matches ( Request $request , $includingMethod ) : bool
Determine if the route matches a given request.
Parameters
- $request Request
- $includingMethod bool
compileRoute ( ) : Symfony\...\CompiledRoute
Compile the route into a Symfony CompiledRoute instance.
bind ( Request $request ) : $this
Bind the route to a given request for execution.
Parameters
- $request Request
hasParameters ( ) : bool
Determine if the route has parameters.
hasParameter ( $name ) : bool
Determine a given parameter exists from the route.
Parameters
- $name string
parameter ( $name , $default ) : string|object|null
Get a given parameter from the route.
Parameters
- $name string
- $default string|object|null
originalParameter ( $name , $default ) : string|null
Get original value of a given parameter from the route.
Parameters
- $name string
- $default string|null
setParameter ( $name , $value ) : void
Set a parameter to the given value.
Parameters
- $name string
- $value string|object|null
forgetParameter ( $name ) : void
Unset a parameter on the route if it is set.
Parameters
- $name string
parameters ( ) : array
Get the key / value list of parameters for the route.
originalParameters ( ) : array
Get the key / value list of original parameters for the route.
parametersWithoutNulls ( ) : array
Get the key / value list of parameters without null values.
parameterNames ( ) : array
Get all of the parameter names for the route.
compileParameterNames ( ) : array
Get the parameter names for the route.
signatureParameters ( $conditions ) : array
Get the parameters that are listed in the route / controller signature.
Parameters
- $conditions array
bindingFieldFor ( $parameter ) : string|null
Get the binding field for the given parameter.
Parameters
- $parameter string|int
bindingFields ( ) : array
Get the binding fields for the route.
setBindingFields ( array $bindingFields ) : $this
Set the binding fields for the route.
Parameters
- $bindingFields array
parentOfParameter ( $parameter ) : string
Get the parent parameter of the given parameter.
Parameters
- $parameter string
withTrashed ( $withTrashed ) : $this
Allow "trashed" models to be retrieved when resolving implicit model bindings for this route.
Parameters
- $withTrashed bool
allowsTrashedBindings ( ) : bool
Determines if the route allows "trashed" models to be retrieved when resolving implicit model bindings.
defaults ( $key , $value ) : $this
Set a default value for the route.
Parameters
- $key string
- $value mixed
setDefaults ( array $defaults ) : $this
Set the default values for the route.
Parameters
- $defaults array
where ( $name , $expression ) : $this
Set a regular expression requirement on the route.
Parameters
- $name array|string
- $expression string|null
parseWhere ( $name , $expression ) : array
Parse arguments to the where method into an array.
Parameters
- $name array|string
- $expression string
setWheres ( array $wheres ) : $this
Set a list of regular expression requirements on the route.
Parameters
- $wheres array
fallback ( ) : $this
Mark this route as a fallback route.
setFallback ( $isFallback ) : $this
Set the fallback value.
Parameters
- $isFallback bool
methods ( ) : array
Get the HTTP verbs the route responds to.
httpOnly ( ) : bool
Determine if the route only responds to HTTP requests.
httpsOnly ( ) : bool
Determine if the route only responds to HTTPS requests.
secure ( ) : bool
Determine if the route only responds to HTTPS requests.
domain ( $domain ) : $this|string|null
Get or set the domain for the route.
Parameters
- $domain string|null
getDomain ( ) : string|null
Get the domain defined for the route.
getPrefix ( ) : string|null
Get the prefix of the route instance.
prefix ( $prefix ) : $this
Add a prefix to the route URI.
Parameters
- $prefix string
updatePrefixOnAction ( $prefix ) : void
Update the "prefix" attribute on the action array.
Parameters
- $prefix string
uri ( ) : string
Get the URI associated with the route.
setUri ( $uri ) : $this
Set the URI that the route responds to.
Parameters
- $uri string
parseUri ( $uri ) : string
Parse the route URI and normalize / store any implicit binding fields.
Parameters
- $uri string
getName ( ) : string|null
Get the name of the route instance.
name ( $name ) : $this
Add or change the route name.
Parameters
- $name string
named ( $patterns ) : bool
Determine whether the route's name matches the given patterns.
Parameters
- $patterns mixed
uses ( $action ) : $this
Set the handler for the route.
Parameters
- $action Closure |array|string
addGroupNamespaceToStringUses ( $action ) : string
Parse a string based action for the "uses" fluent method.
Parameters
- $action string
getActionName ( ) : string
Get the action name for the route.
getActionMethod ( ) : string
Get the method name of the route action.
getAction ( $key ) : mixed
Get the action array or one of its properties for the route.
Parameters
- $key string|null
setAction ( array $action ) : $this
Set the action array for the route.
Parameters
- $action array
getMissing ( ) : Closure |null
Get the value of the action that should be taken on a missing model exception.
missing ( $missing ) : $this
Define the callable that should be invoked on a missing model exception.
Parameters
- $missing Closure
gatherMiddleware ( ) : array
Get all middleware, including the ones from the controller.
middleware ( $middleware ) : $this|array
Get or set the middlewares attached to the route.
Parameters
- $middleware array|string|null
can ( $ability , $models ) : $this
Specify that the "Authorize" / "can" middleware should be applied to the route with the given options.
Parameters
- $ability string
- $models array|string
controllerMiddleware ( ) : array
Get the middleware for the route's controller.
staticallyProvidedControllerMiddleware ( string $class , string $method ) : array
Get the statically provided controller middleware for the given class and method.
Parameters
- $class string
- $method string
withoutMiddleware ( $middleware ) : $this
Specify middleware that should be removed from the given route.
Parameters
- $middleware array|string
excludedMiddleware ( ) : array
Get the middleware should be removed from the route.
scopeBindings ( ) : $this
Indicate that the route should enforce scoping of multiple implicit Eloquent bindings.
withoutScopedBindings ( ) : $this
Indicate that the route should not enforce scoping of multiple implicit Eloquent bindings.
enforcesScopedBindings ( ) : bool
Determine if the route should enforce scoping of multiple implicit Eloquent bindings.
preventsScopedBindings ( ) : bool
Determine if the route should prevent scoping of multiple implicit Eloquent bindings.
block ( $lockSeconds , $waitSeconds ) : $this
Specify that the route should not allow concurrent requests from the same session.
Parameters
- $lockSeconds int|null
- $waitSeconds int|null
withoutBlocking ( ) : $this
Specify that the route should allow concurrent requests from the same session.
locksFor ( ) : int|null
Get the maximum number of seconds the route's session lock should be held for.
waitsFor ( ) : int|null
Get the maximum number of seconds to wait while attempting to acquire a session lock.
controllerDispatcher ( ) : ControllerDispatcher
Get the dispatcher for the route's controller.
getValidators ( ) : array
Get the route validators for the instance.
toSymfonyRoute ( ) : Symfony\...\Route
Convert the route to a Symfony route.
getOptionalParameterNames ( ) : array
Get the optional parameter names for the route.
getCompiled ( ) : Symfony\...\CompiledRoute
Get the compiled version of the route.
setRouter ( Router $router ) : $this
Set the router instance on the route.
Parameters
- $router Router
setContainer ( Container $container ) : $this
Set the container instance on the route.
Parameters
- $container Container
prepareForSerialization ( ) : void
Prepare the route instance for serialization.
__get ( $key ) : mixed
Dynamically access route parameters.
Parameters
- $key string