class Illuminate / Auth / Middleware / Authorize
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

Authorize

Properties

protected

$gate Gate

The gate instance.

Default: null

Methods

public

__construct ( Gate $gate ) : void

Create a new middleware instance.

Parameters

public static

using ( $ability , $models ) : string

Specify the ability and models for the middleware.

Parameters

  • $ability string
  • $models string
public

handle ( $request , Closure $next , $ability , $models ) : mixed

Handle an incoming request.

Parameters

protected

getGateArguments ( $request , $models ) : Model |array|string

Get the arguments parameter for the gate.

Parameters

protected

getModel ( $request , $model ) : Model |string

Get the model to authorize.

Parameters

protected

isClassName ( $value ) : bool

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

Parameters

  • $value string