MissingAbilityException
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.
withStatus(int|null $status)
Set the HTTP response status code.
asNotFound()
Set the HTTP response status code to 404.
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.
in
AuthorizationException at line 35
Response|null
response()
Get the response from the gate.
in
AuthorizationException at line 43
AuthorizationException
setResponse(Response|null $response)
Set the response from the gate.
in
AuthorizationException at line 53
AuthorizationException
withStatus(int|null $status)
Set the HTTP response status code.
in
AuthorizationException at line 63
AuthorizationException
asNotFound()
Set the HTTP response status code to 404.
in
AuthorizationException at line 71
bool
hasStatus()
Determine if the HTTP status code has been set.
in
AuthorizationException at line 79
int|null
status()
Get the HTTP status code.
in
AuthorizationException at line 87
Response
toResponse()
Create a deny response object from this exception.
at line 36
array
abilities()
Get the abilities that the user did not have.