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

__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.

string

Returns the controller class selected by the matched route.

string
string
action()

Returns the public controller method selected by the matched route.

string

Returns the immutable controller target used by dispatch.

string|null
name()

Returns the globally unique route name, or null for an unnamed route.

string|null
string|null
method()

Returns the canonical method of the matched route when the match originated from Router.

string|null
string|null
path()

Returns the canonical route template selected by Router, including placeholders.

string|null
array
params()

Returns decoded route parameters indexed by placeholder name.

array
array

Returns route-specific middleware in execution order.

array

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.

Parameters

ControllerAction $controllerAction
array $params
array $middleware
string|null $name
string|null $method
string|null $path

controller

string controller()

Returns the controller class selected by the matched route.

Return Value

string

action

string action()

Returns the public controller method selected by the matched route.

Return Value

string

controllerAction

ControllerAction controllerAction()

Returns the immutable controller target used by dispatch.

Return Value

ControllerAction

name

string|null name()

Returns the globally unique route name, or null for an unnamed route.

Return Value

string|null

method

string|null method()

Returns the canonical method of the matched route when the match originated from Router.

Return Value

string|null

path

string|null path()

Returns the canonical route template selected by Router, including placeholders.

Return Value

string|null

params

array params()

Returns decoded route parameters indexed by placeholder name.

Return Value

array

middleware

array middleware()

Returns route-specific middleware in execution order.

Return Value

array