trait HandlesAuthorization (View source)

Methods

allow(string|null $message = null, mixed $code = null)

Create a new access response.

deny(string|null $message = null, mixed|null $code = null)

Throws an unauthorized exception.

denyWithStatus(int $status, string|null $message = null, int|null $code = null)

Deny with a HTTP status code.

denyAsNotFound(string|null $message = null, int|null $code = null)

Deny with a 404 HTTP status code.

Details

protected Response allow(string|null $message = null, mixed $code = null)

Create a new access response.

Parameters

string|null $message
mixed $code

Return Value

Response

protected Response deny(string|null $message = null, mixed|null $code = null)

Throws an unauthorized exception.

Parameters

string|null $message
mixed|null $code

Return Value

Response

Response denyWithStatus(int $status, string|null $message = null, int|null $code = null)

Deny with a HTTP status code.

Parameters

int $status
string|null $message
int|null $code

Return Value

Response

Response denyAsNotFound(string|null $message = null, int|null $code = null)

Deny with a 404 HTTP status code.

Parameters

string|null $message
int|null $code

Return Value

Response

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.