uuid = $uuid; $token = Session::get('user')['access_token'] ?? null; if (!$token) { $this->addError('users', 'No access token found.'); return; } $response = Http::withToken($token)->get(config('services.backend_api.url') . "/api/cms/TermsAndPrivacy/{$uuid}"); if ($response->successful()) { $termsAndPrivacy = $response->json('data'); $this->type = $termsAndPrivacy['type'] ?? ''; $this->title = $termsAndPrivacy['title'] ?? ''; $this->details = $termsAndPrivacy['details'] ?? ''; } else { $this->addError('terms and privacy', 'Failed to fetch terms and privacy data.'); } } public function render() { return view('livewire.buttons.view-terms-and-privacy'); } }