trait Authorizable (View source)

Methods

authorize(UnitEnum|string $ability, mixed $arguments = [])

Determine if the given ability should be granted for the entity.

bool
can(iterable|UnitEnum|string $abilities, mixed $arguments = [])

Determine if the entity has the given abilities.

bool
canAny(iterable|UnitEnum|string $abilities, mixed $arguments = [])

Determine if the entity has any of the given abilities.

bool
cant(iterable|UnitEnum|string $abilities, mixed $arguments = [])

Determine if the entity does not have the given abilities.

bool
cannot(iterable|UnitEnum|string $abilities, mixed $arguments = [])

Determine if the entity does not have the given abilities.

Details

Response authorize(UnitEnum|string $ability, mixed $arguments = [])

Determine if the given ability should be granted for the entity.

Parameters

UnitEnum|string $ability
mixed $arguments

Return Value

Response

Exceptions

AuthorizationException

bool can(iterable|UnitEnum|string $abilities, mixed $arguments = [])

Determine if the entity has the given abilities.

Parameters

iterable|UnitEnum|string $abilities
mixed $arguments

Return Value

bool

bool canAny(iterable|UnitEnum|string $abilities, mixed $arguments = [])

Determine if the entity has any of the given abilities.

Parameters

iterable|UnitEnum|string $abilities
mixed $arguments

Return Value

bool

bool cant(iterable|UnitEnum|string $abilities, mixed $arguments = [])

Determine if the entity does not have the given abilities.

Parameters

iterable|UnitEnum|string $abilities
mixed $arguments

Return Value

bool

bool cannot(iterable|UnitEnum|string $abilities, mixed $arguments = [])

Determine if the entity does not have the given abilities.

Parameters

iterable|UnitEnum|string $abilities
mixed $arguments

Return Value

bool

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.