uuid = $uuid; $token = Session::get('user.access_token'); if (!$token) { $this->addError('users', 'No access token found.'); return; } $response = Http::withToken($token)->get(config('services.backend_api.url') . "/api/cms/topUp/{$uuid}"); if ($response->successful()) { $topUp = $response->json('data'); $this->fee_code = $topUp['fee_code'] ?? ''; $this->name = $topUp['name'] ?? ''; $this->type = $topUp['type'] ?? ''; $this->amount = $topUp['amount'] ?? 0; } else { $this->addError('top ups', 'Failed to fetch top up data.'); } } public function render() { return view('livewire.buttons.view-top-up'); } }