get('/energy-prices/electricity/upcoming'); } public function getGasPrices(): array { return $this->get('/energy-prices/gas/upcoming'); } /** @return array> */ private function get(string $path): array { try { $response = $this->http ->baseUrl(config('api.baseurl')) ->withQueryParameters([ 'secret' => config('api.key'), ]) ->timeout(10) ->retry(2, 100) ->get($path); $response->throw(); Log::info('Zonneplan API opgehaald', [ 'path' => $path, 'status' => $response->status(), ]); return $response->json('data', []); } catch (Throwable $e) { Log::error('Zonneplan API aanroep mislukt', [ 'path' => $path, 'message' => $e->getMessage(), ]); throw new Exception( "Kon energieprijzen niet ophalen voor {$path}", previous: $e, ); } } }