MiddlewareContract
in
Table of Contents
Methods
- execute() : void
- This method is called to run the middleware. Every middleware must implement this method.
- onRequest() : mixed
- This method is called to run the middleware against the incoming request. Every middleware must implement this method.
- onResponse() : mixed
- This method is called to run the middleware against every response. Every middleware must implement this method.
Methods
execute()
This method is called to run the middleware. Every middleware must implement this method.
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 against the incoming request. 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 against every response. Every middleware must implement this method.
public
onResponse(Response $response) : mixed
Parameters
- $response : Response
-
- The response object