name = $name; $this->label = $label; $this->required = $required; $this->url = $url; $this->optionsList = $optionsList; if ($url) { $this->fetchOptions(); } } public function fetchOptions() { try { $response = Http::get($this->url); $this->optionsList = $response->json('data') ?? []; } catch (\Exception $e) { session()->flash('error', 'Failed to load options: ' . $e->getMessage()); } } public function updatedValue() { $this->dispatch('selectChanged', $this->value); } public function render() { return view('livewire.select-form'); } }