class MissingAbilityException extends AuthorizationException

Properties

protected Response|null $response

The response from the gate.

from  AuthorizationException
protected int|null $status

The HTTP response status code.

from  AuthorizationException
protected string[] $abilities

The abilities that the user did not have.

Methods

__construct(array|string $abilities = [], string|null $message = 'Invalid ability provided.')

Create a new missing scope exception.

Response|null
response()

Get the response from the gate.

setResponse(Response|null $response)

Set the response from the gate.

withStatus(int|null $status)

Set the HTTP response status code.

asNotFound()

Set the HTTP response status code to 404.

bool
hasStatus()

Determine if the HTTP status code has been set.

int|null
status()

Get the HTTP status code.

toResponse()

Create a deny response object from this exception.

array
abilities()

Get the abilities that the user did not have.

Details

at line 24
__construct(array|string $abilities = [], string|null $message = 'Invalid ability provided.')

Create a new missing scope exception.

Parameters

array|string $abilities
string|null $message

Response|null response()

Get the response from the gate.

Return Value

Response|null

AuthorizationException setResponse(Response|null $response)

Set the response from the gate.

Parameters

Response|null $response

Return Value

AuthorizationException

AuthorizationException withStatus(int|null $status)

Set the HTTP response status code.

Parameters

int|null $status

Return Value

AuthorizationException

AuthorizationException asNotFound()

Set the HTTP response status code to 404.

Return Value

AuthorizationException

bool hasStatus()

Determine if the HTTP status code has been set.

Return Value

bool

int|null status()

Get the HTTP status code.

Return Value

int|null

Response toResponse()

Create a deny response object from this exception.

Return Value

Response

at line 36
array abilities()

Get the abilities that the user did not have.

Return Value

array