Determine if the given ability should be granted for the current user.
/** * 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')]); }