MissingAbilityException
class MissingAbilityException extends AuthorizationException
Properties
| protected Response|null | $response | The authorization response returned by 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
Create a new missing ability exception.
Set the HTTP response status code.
Set the HTTP response status code to 404.
Create a deny response object from this exception.
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 ability exception.
in
AuthorizationException at line 35
Response|null
response()
Get the response from the gate.
in
AuthorizationException at line 45
AuthorizationException
setResponse(Response|null $response)
Set the response from the gate.
in
AuthorizationException at line 57
AuthorizationException
withStatus(int|null $status)
Set the HTTP response status code.
in
AuthorizationException at line 69
AuthorizationException
asNotFound()
Set the HTTP response status code to 404.
in
AuthorizationException at line 77
bool
hasStatus()
Determine if the HTTP status code has been set.
in
AuthorizationException at line 85
int|null
status()
Get the HTTP status code.
in
AuthorizationException at line 93
Response
toResponse()
Create a deny response object from this exception.
at line 36
array
abilities()
Get the abilities that the user did not have.