class Route extends Route (View source)

Properties

protected string $customName If this route has a custom name, it appears here. Otherwise it is automatically generated from the path.
protected mixed $action The action that the route will execute when it is run.
protected RouteMiddleware[] $middlewares

Methods

bool
hasCustomName()

No description

mixed
getAction()

No description

setAction(mixed $action)

No description

mixed
getName()

No description

setCustomName($name)

Sets the custom name. Note: if the route has already been added to the route collection you will want to use $route->updateName($name, $router) instead

updateName($name, Router $router)

No description

getGeneratedName()

No description

addMiddleware(RouteMiddleware $middleware)

Adds middleware to the route.

getMiddlewares()

No description

setScopes(string $scope)

Explicitly sets an OAuth2 scope to a route. This will be used if the route is consumed in an OAuth2 request.

Details

bool hasCustomName()

Return Value

bool

mixed getAction()

Return Value

mixed

setAction(mixed $action)

Parameters

mixed $action

mixed getName()

Return Value

mixed

setCustomName($name)

Sets the custom name. Note: if the route has already been added to the route collection you will want to use $route->updateName($name, $router) instead

Parameters

$name

updateName($name, Router $router)

Parameters

$name
Router $router

private getGeneratedName()

addMiddleware(RouteMiddleware $middleware)

Adds middleware to the route.

Parameters

RouteMiddleware $middleware

RouteMiddleware[] getMiddlewares()

Return Value

RouteMiddleware[]

setScopes(string $scope)

Explicitly sets an OAuth2 scope to a route. This will be used if the route is consumed in an OAuth2 request.

Parameters

string $scope