class InvalidAuthTokenException 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

Methods

__construct(string|null $message = null, int|string|null $code = null, Throwable|null $previous = null)

Create a new authorization exception instance.

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.

different()

Create a new InvalidAuthTokenException for different auth tokens.

Details

__construct(string|null $message = null, int|string|null $code = null, Throwable|null $previous = null)

Create a new authorization exception instance.

Parameters

string|null $message
int|string|null $code
Throwable|null $previous

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 14
static InvalidAuthTokenException different()

Create a new InvalidAuthTokenException for different auth tokens.