PHP Class Dingo\Api\Http\Middleware\Request

Show file Open project: dingo/api Class Usage Examples

Protected Properties

Property Type Description
$app Illuminate\Contracts\Foundation\Application Application instance.
$events Illuminate\Events\Dispatcher Event dispatcher instance.
$exception Dingo\Api\Contract\Debug\ExceptionHandler Exception handler instance.
$middleware array Array of middleware.
$router Dingo\Api\Routing\Router Router instance.
$validator Dingo\Api\Http\Validator HTTP validator instance.

Public Methods

Method Description
__construct ( Illuminate\Contracts\Container\Container $app, Dingo\Api\Contract\Debug\ExceptionHandler $exception, Router $router, RequestValidator $validator, Illuminate\Events\Dispatcher $events ) : void Create a new request middleware instance.
handle ( Illuminate\Http\Request $request, Closure $next ) : mixed Handle an incoming request.
mergeMiddlewares ( array $middleware ) : void Merge new middlewares onto the existing middlewares.
setMiddlewares ( array $middleware ) : void Set the middlewares.
terminate ( $request, $response ) : void Call the terminate method on middlewares.

Protected Methods

Method Description
gatherRouteMiddlewares ( Dingo\Api\Http\Request $request ) : array Gather the middlewares for the route.
parseMiddleware ( string $middleware ) : array Parse a middleware string to get the name and parameters.
sendRequestThroughRouter ( Dingo\Api\Http\Request $request ) : Response Send the request through the Dingo router.

Method Details

__construct() public method

Create a new request middleware instance.
public __construct ( Illuminate\Contracts\Container\Container $app, Dingo\Api\Contract\Debug\ExceptionHandler $exception, Router $router, RequestValidator $validator, Illuminate\Events\Dispatcher $events ) : void
$app Illuminate\Contracts\Container\Container
$exception Dingo\Api\Contract\Debug\ExceptionHandler
$router Dingo\Api\Routing\Router
$validator Dingo\Api\Http\RequestValidator
$events Illuminate\Events\Dispatcher
return void

gatherRouteMiddlewares() protected method

Gather the middlewares for the route.
protected gatherRouteMiddlewares ( Dingo\Api\Http\Request $request ) : array
$request Dingo\Api\Http\Request
return array

handle() public method

Handle an incoming request.
public handle ( Illuminate\Http\Request $request, Closure $next ) : mixed
$request Illuminate\Http\Request
$next Closure
return mixed

mergeMiddlewares() public method

Merge new middlewares onto the existing middlewares.
public mergeMiddlewares ( array $middleware ) : void
$middleware array
return void

parseMiddleware() protected method

Parse a middleware string to get the name and parameters.
Author: Taylor Otwell
protected parseMiddleware ( string $middleware ) : array
$middleware string
return array

sendRequestThroughRouter() protected method

Send the request through the Dingo router.
protected sendRequestThroughRouter ( Dingo\Api\Http\Request $request ) : Response
$request Dingo\Api\Http\Request
return Dingo\Api\Http\Response

setMiddlewares() public method

Set the middlewares.
public setMiddlewares ( array $middleware ) : void
$middleware array
return void

terminate() public method

Call the terminate method on middlewares.
public terminate ( $request, $response ) : void
return void

Property Details

$app protected property

Application instance.
protected Application,Illuminate\Contracts\Foundation $app
return Illuminate\Contracts\Foundation\Application

$events protected property

Event dispatcher instance.
protected Dispatcher,Illuminate\Events $events
return Illuminate\Events\Dispatcher

$exception protected property

Exception handler instance.
protected ExceptionHandler,Dingo\Api\Contract\Debug $exception
return Dingo\Api\Contract\Debug\ExceptionHandler

$middleware protected property

Array of middleware.
protected array $middleware
return array

$router protected property

Router instance.
protected Router,Dingo\Api\Routing $router
return Dingo\Api\Routing\Router

$validator protected property

HTTP validator instance.
protected Validator,Dingo\Api\Http $validator
return Dingo\Api\Http\Validator