user()->isAdmin() || auth()->user()->isOwner()) && (int)$this->account->id === auth()->user()->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 */ protected function prepareForValidation() { $input = $this->all(); $cleaned_input = array_intersect_key( $input, array_flip(['set_react_as_default_ap'])); $this->replace($cleaned_input); } }