canGate && $this->canResource && $this->autoDisable) { $hasPermission = Gate::allows($this->canGate, $this->canResource); if (! $hasPermission) { $this->disabled = true; $this->instantSave = false; // Disable instant save for unauthorized users } } if ($this->disabled) { $this->defaultClass .= ' opacity-40'; } } /** * Get the view / contents that represent the component. */ public function render(): View|Closure|string { return view('components.forms.checkbox'); } }