Authorize

class Authorize (View source)

Properties

protected Gate $gate The gate instance.

Methods

void __construct(Gate $gate)

Create a new middleware instance.

mixed handle(Request $request, Closure $next, string $ability, string|null $model = null)

Handle an incoming request.

array|string|Model getGateArguments(Request $request, string|null $model)

Get the arguments parameter for the gate.

Details

void __construct(Gate $gate)

Create a new middleware instance.

Parameters

Gate $gate

Return Value

void

mixed handle(Request $request, Closure $next, string $ability, string|null $model = null)

Handle an incoming request.

Parameters

Request $request
Closure $next
string $ability
string|null $model

Return Value

mixed

Exceptions

AuthorizationException

protected array|string|Model getGateArguments(Request $request, string|null $model)

Get the arguments parameter for the gate.

Parameters

Request $request
string|null $model

Return Value

array|string|Model

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.2/Illuminate/Foundation/Http/Middleware/Authorize.html