AuthorizationException
class AuthorizationException extends Exception
Properties
| protected Response|null | $response | The response from the gate. |
|
| protected int|null | $status | The HTTP response status code. |
Methods
__construct(string|null $message = null, int|string|null $code = null, Throwable|null $previous = null)
Create a new authorization exception instance.
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.
Details
at line 25
__construct(string|null $message = null, int|string|null $code = null, Throwable|null $previous = null)
Create a new authorization exception instance.
at line 35
Response|null
response()
Get the response from the gate.
at line 43
AuthorizationException
setResponse(Response|null $response)
Set the response from the gate.
at line 53
AuthorizationException
withStatus(int|null $status)
Set the HTTP response status code.
at line 63
AuthorizationException
asNotFound()
Set the HTTP response status code to 404.
at line 71
bool
hasStatus()
Determine if the HTTP status code has been set.
at line 79
int|null
status()
Get the HTTP status code.
at line 87
Response
toResponse()
Create a deny response object from this exception.