MiddlewareContract
in
Table of Contents
Methods
- execute() : void
- This method is called before the middleware runs against the request.
- onRequest() : mixed
- This method is called to run the middleware. Every middleware must implement this method.
- onResponse() : mixed
- This method is called to run the middleware. Every middleware must implement this method.
Methods
execute()
This method is called before the middleware runs against the request.
public
execute(Request $request, Response $response, MiddlewareChain $chain) : void
Parameters
- $request : Request
- $response : Response
- $chain : MiddlewareChain
onRequest()
This method is called to run the middleware. Every middleware must implement this method.
public
onRequest(Request $request) : mixed
Parameters
- $request : Request
-
- The request object
onResponse()
This method is called to run the middleware. Every middleware must implement this method.
public
onResponse(Response $response) : mixed
Parameters
- $response : Response
-
- The response object