Documentation

Authorize
in package

Table of Contents

$auth  : Factory
The authentication factory instance.
$gate  : Gate
The gate instance.
__construct()  : void
Create a new middleware instance.
handle()  : mixed
Handle an incoming request.
getGateArguments()  : array<string|int, mixed>|string|Model
Get the arguments parameter for the gate.
getModel()  : Model|string
Get the model to authorize.
isClassName()  : bool
Checks if the given string looks like a fully qualified class name.

Properties

Methods

__construct()

Create a new middleware instance.

public __construct(Factory $auth, Gate $gate) : void
Parameters
$auth : Factory
$gate : Gate
Return values
void

handle()

Handle an incoming request.

public handle(Request $request, Closure $next, string $ability, array<string|int, mixed>|null ...$models) : mixed
Parameters
$request : Request
$next : Closure
$ability : string
$models : array<string|int, mixed>|null
Tags
throws
AuthenticationException
throws
AuthorizationException
Return values
mixed

getGateArguments()

Get the arguments parameter for the gate.

protected getGateArguments(Request $request, array<string|int, mixed>|null $models) : array<string|int, mixed>|string|Model
Parameters
$request : Request
$models : array<string|int, mixed>|null
Return values
array<string|int, mixed>|string|Model

getModel()

Get the model to authorize.

protected getModel(Request $request, string $model) : Model|string
Parameters
$request : Request
$model : string
Return values
Model|string

isClassName()

Checks if the given string looks like a fully qualified class name.

protected isClassName(string $value) : bool
Parameters
$value : string
Return values
bool

Search results