fetchTerms(); } public function fetchTerms() { try { $response = Http::get('https://api.example.com/TermsAndPrivacy?page=1&page_size=10&_sort_by=create_dt&_sort_order=desc'); $this->terms = $response->json()['data'] ?? []; } catch (\Exception $e) { session()->flash('error', 'Failed to load terms and privacy: ' . $e->getMessage()); } } public function delete($uuid) { try { $response = Http::delete("https://api.example.com/TermsAndPrivacy/{$uuid}"); if ($response->successful()) { session()->flash('success', 'Record was successfully deleted.'); $this->fetchTerms(); } } catch (\Exception $e) { session()->flash('error', 'Failed to delete record: ' . $e->getMessage()); } } public function render() { return view('livewire.about-us.term-and-privacy.term-and-privacy-list'); } }