RouteMatch
final class RouteMatch (View source)
Carries the immutable route identity and extracted parameters selected by the canonical Router.
Manually constructed matches may omit method and path metadata for compatibility, while Router matches always expose both values for downstream routing and authorization boundaries.
Methods
Captures the selected controller, route middleware, parameters and canonical route identity.
Returns the controller class selected by the matched route.
Returns the public controller method selected by the matched route.
Returns the immutable controller target used by dispatch.
Returns the globally unique route name, or null for an unnamed route.
Returns the canonical method of the matched route when the match originated from Router.
Returns the canonical route template selected by Router, including placeholders.
Returns decoded route parameters indexed by placeholder name.
Returns route-specific middleware in execution order.
Details
__construct
__construct(ControllerAction $controllerAction, array $params = [], array $middleware = [], string|null $name = null, string|null $method = null, string|null $path = null)
Captures the selected controller, route middleware, parameters and canonical route identity.
controller
string
controller()
Returns the controller class selected by the matched route.
action
string
action()
Returns the public controller method selected by the matched route.
controllerAction
ControllerAction
controllerAction()
Returns the immutable controller target used by dispatch.
name
string|null
name()
Returns the globally unique route name, or null for an unnamed route.
method
string|null
method()
Returns the canonical method of the matched route when the match originated from Router.
path
string|null
path()
Returns the canonical route template selected by Router, including placeholders.
params
array
params()
Returns decoded route parameters indexed by placeholder name.
middleware
array
middleware()
Returns route-specific middleware in execution order.