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 { // Store original ID for wire:model binding (property name) $this->modelBinding = $this->id; $this->htmlId = $this->id; // Generate unique HTML ID by prefixing with Livewire component ID if available if ($this->id) { $livewireId = $this->attributes?->wire('id'); if ($livewireId) { $this->htmlId = $livewireId.'-'.$this->id; } } return view('components.forms.checkbox'); } }