user()->isAdmin() || auth()->user()->isOwner()) && ($this->account->id == auth()->user()->token()->account_id); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'set_react_as_default_ap' => 'required|bail|bool', ]; } /* Only allow single field to update account table */ public function prepareForValidation() { $input = $this->all(); $cleaned_input = array_intersect_key($input, array_flip(['set_react_as_default_ap'])); $this->replace($cleaned_input); } }