authorize() public static method

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
return Illuminate\Auth\Access\Response
Exemplo n.º 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')]);
 }