Gate::authorize PHP Méthode

authorize() public static méthode

Determine if the given ability should be granted for the current user.
public static authorize ( string $ability, array | mixed $arguments = [] ) : Illuminate\Auth\Access\Response
$ability string
$arguments array | mixed
Résultat Illuminate\Auth\Access\Response
        public static function authorize($ability, $arguments = array())
        {
            return \Illuminate\Auth\Access\Gate::authorize($ability, $arguments);
        }

Usage Example

Exemple #1
0
 /**
  * Determine if the user is authorized to make this request.
  *
  * @return bool
  */
 public function authorize()
 {
     return \Gate::authorize($this->input('id', null) ? 'update' : 'create', [$this->user(), $this->input('id')]);
 }