class Illuminate / Auth / Access / AuthorizationException

AuthorizationException

Extends

Properties

protected

$response Response

The response from the gate.

Default: null
protected

$status int|null

The HTTP response status code.

Default: null

Methods

public

__construct ( $message , $code , Throwable $previous ) : void

Create a new authorization exception instance.

Parameters

  • $message string|null
  • $code mixed
  • $previous Throwable |null
public

response ( ) : Response

Get the response from the gate.

public

setResponse ( $response ) : $this

Set the response from the gate.

Parameters

public

withStatus ( $status ) : $this

Set the HTTP response status code.

Parameters

  • $status int|null
public

asNotFound ( ) : $this

Set the HTTP response status code to 404.

public

hasStatus ( ) : bool

Determine if the HTTP status code has been set.

public

status ( ) : int|null

Get the HTTP status code.

public

toResponse ( ) : Response

Create a deny response object from this exception.