class ControllerMiddleware (View source)

Redirect users who do not have a capability to a specific URL.

Methods

__construct(string|array $middleware)

Constructor.

array
get()

Get middleware.

only(string|array $methods)

Set methods the middleware should apply to.

except(string|array $methods)

Set methods the middleware should not apply to.

boolean
appliesTo(string $method)

Get whether the middleware applies to the specified method.

Details

__construct(string|array $middleware)

Constructor.

Parameters

string|array $middleware

array get()

Get middleware.

Return Value

array

ControllerMiddleware only(string|array $methods)

Set methods the middleware should apply to.

Parameters

string|array $methods

Return Value

ControllerMiddleware

ControllerMiddleware except(string|array $methods)

Set methods the middleware should not apply to.

Parameters

string|array $methods

Return Value

ControllerMiddleware

boolean appliesTo(string $method)

Get whether the middleware applies to the specified method.

Parameters

string $method

Return Value

boolean