url = $url; $this->avatar = $avatar; $this->viewPath = $viewPath; $this->header = $header; $this->footer = $footer; $this->fetchData(); } public function fetchData() { try { $response = Http::get($this->url); $this->data = $response->json('data') ?? []; } catch (\Exception $e) { session()->flash('error', 'Failed to load data: ' . $e->getMessage()); } } public function render() { return view('livewire.data-list'); } }