From c7434186b312c025af244f8d3a203a72411b7f22 Mon Sep 17 00:00:00 2001 From: M Lintang Maulana Zulfan Date: Thu, 14 May 2026 13:22:45 +0700 Subject: [PATCH] Fix geocoding fallback when AMap key is missing --- app/Services/GeocodingService.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Services/GeocodingService.php b/app/Services/GeocodingService.php index 8308a7f..8adf350 100644 --- a/app/Services/GeocodingService.php +++ b/app/Services/GeocodingService.php @@ -45,6 +45,10 @@ public function getCoordinates($alamat, $negara) protected function getCoordinatesChina($alamat) { + if (! $this->amapWebKey) { + return ['lat' => 0.0, 'lng' => 0.0]; + } + $urlPOI = 'https://restapi.amap.com/v3/place/text'; $resPOI = Http::get($urlPOI, [ 'keywords' => $alamat,