public function geoCoding($zip_code){ $api = 'https://maps.googleapis.com/maps/api/geocode/json?address='; $par = '&key='; $goo = env('GOOGLE_KEY'); $url = $api . $zip_code . $par . $goo; $file = file_get_contents($url); $json = json_decode($file, true); $lat = $json['results'][0]['geometry']['location']['lat']; $lon = $json['results'][0]['geometry']['location']['lng']; $geo = array($lat, $lon); return $geo; }