interface RouteInterface implements HasMiddlewareInterface (View source)

Interface that routes must implement

Methods

array
getMiddleware()

Get registered middleware

object
addMiddleware(string|Closure|MiddlewareInterface|array $middleware)

Add middleware

object
add(string|Closure|MiddlewareInterface|array $middleware)

Alias for addMiddleware.

ResponseInterface
executeMiddleware(array $middleware, Request $request, Closure $next)

Execute an array of middleware recursively (last in, first out)

boolean
isSatisfied(Request $request)

Get whether the route is satisfied.

ResponseInterface
handle(Request $request, string $view)

Get a response for the given request.

array
getArguments(Request $request)

Get arguments.

Details

array getMiddleware()

Get registered middleware

Return Value

array

object addMiddleware(string|Closure|MiddlewareInterface|array $middleware)

Add middleware

Parameters

string|Closure|MiddlewareInterface|array $middleware

Return Value

object $this

object add(string|Closure|MiddlewareInterface|array $middleware)

Alias for addMiddleware.

Accepts: a class name, an instance of a class, a Closure or an array of any of the previous

Parameters

string|Closure|MiddlewareInterface|array $middleware

Return Value

object $this

ResponseInterface executeMiddleware(array $middleware, Request $request, Closure $next)

Execute an array of middleware recursively (last in, first out)

Parameters

array $middleware
Request $request
Closure $next

Return Value

ResponseInterface

boolean isSatisfied(Request $request)

Get whether the route is satisfied.

Parameters

Request $request

Return Value

boolean

ResponseInterface handle(Request $request, string $view)

Get a response for the given request.

Parameters

Request $request
string $view

Return Value

ResponseInterface

array getArguments(Request $request)

Get arguments.

Parameters

Request $request

Return Value

array