Menu

## MiddlewareContract
in

MiddlewareContract.php : 9

### 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()

MiddlewareContract.php : 28

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()

MiddlewareContract.php : 16

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()

MiddlewareContract.php : 23

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

## Search results