class ControllerMiddleware (View source)

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

Methods

__construct(string|string[] $middleware)

Constructor.

string[]
get()

Get middleware.

only(string|string[] $methods)

Set methods the middleware should apply to.

except(string|string[] $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|string[] $middleware)

Constructor.

Parameters

string|string[] $middleware

string[] get()

Get middleware.

Return Value

string[]

ControllerMiddleware only(string|string[] $methods)

Set methods the middleware should apply to.

Parameters

string|string[] $methods

Return Value

ControllerMiddleware

ControllerMiddleware except(string|string[] $methods)

Set methods the middleware should not apply to.

Parameters

string|string[] $methods

Return Value

ControllerMiddleware

boolean appliesTo(string $method)

Get whether the middleware applies to the specified method.

Parameters

string $method

Return Value

boolean