AuthorizesRequests
trait AuthorizesRequests (View source)
Methods
Response | authorize(mixed $ability, mixed|array $arguments = []) Authorize a given action for the current user. | |
Response | authorizeForUser(Authenticatable|mixed $user, mixed $ability, mixed|array $arguments = []) Authorize a given action for a user. | |
array | parseAbilityAndArguments(mixed $ability, mixed|array $arguments) Guesses the ability's name if it wasn't provided. | |
string | normalizeGuessedAbilityName(string $ability) Normalize the ability name that has been guessed from the method name. | |
void | authorizeResource(string $model, string|null $parameter = null, array $options = [], Request|null $request = null) Authorize a resource action based on the incoming request. | |
array | resourceAbilityMap() Get the map of resource methods to ability names. | |
array | resourceMethodsWithoutModels() Get the list of resource methods which do not have model parameters. |
Details
Response authorize(mixed $ability, mixed|array $arguments = [])
Authorize a given action for the current user.
Response authorizeForUser(Authenticatable|mixed $user, mixed $ability, mixed|array $arguments = [])
Authorize a given action for a user.
protected array parseAbilityAndArguments(mixed $ability, mixed|array $arguments)
Guesses the ability's name if it wasn't provided.
protected string normalizeGuessedAbilityName(string $ability)
Normalize the ability name that has been guessed from the method name.
void authorizeResource(string $model, string|null $parameter = null, array $options = [], Request|null $request = null)
Authorize a resource action based on the incoming request.
protected array resourceAbilityMap()
Get the map of resource methods to ability names.
protected array resourceMethodsWithoutModels()
Get the list of resource methods which do not have model parameters.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.7/Illuminate/Foundation/Auth/Access/AuthorizesRequests.html