user(); return $user->isAdmin(); } public function rules() { /** @var \App\Models\User $user */ $user = auth()->user(); $rules = []; $rules['rate'] = 'required|numeric'; if ($this->name) { $rules['name'] = Rule::unique('tax_rates')->where('company_id', auth()->user()->company()->id)->ignore($this->tax_rate->id); } return $rules; } }