AuthorizesRequests
trait AuthorizesRequests
Methods
Authorize a given action for the current user.
Authorize a given action for a user.
Guesses the ability's name if it wasn't provided.
Normalize the ability name that has been guessed from the method name.
Authorize a resource action based on the incoming request.
Get the map of resource methods to ability names.
Get the list of resource methods which do not have model parameters.
Details
at line 24
Response
authorize(mixed $ability, mixed $arguments = [])
Authorize a given action for the current user.
at line 36
Response
authorizeForUser(mixed $user, mixed $ability, mixed $arguments = [])
Authorize a given action for a user.
at line 46
protected array
parseAbilityAndArguments(mixed $ability, mixed $arguments = [])
Guesses the ability's name if it wasn't provided.
at line 64
protected string
normalizeGuessedAbilityName(string $ability)
Normalize the ability name that has been guessed from the method name.
at line 74
void
authorizeResource(string|array $model, string|array|null $parameter = null, array $options = [], Request|null $request = null)
Authorize a resource action based on the incoming request.
at line 98
protected array
resourceAbilityMap()
Get the map of resource methods to ability names.
at line 116
protected array
resourceMethodsWithoutModels()
Get the list of resource methods which do not have model parameters.