city($ip); $countryCode = strtolower($record->country->isoCode); } catch (Exception $e) { return [ $config['maxmind']['code_fallback'], $config['maxmind']['country_fallback'], ]; } $countryName = $record->country->name; if (empty($countryName)) { $countryName = $config['maxmind']['country_fallback']; $countryCode = $config['maxmind']['code_fallback']; } return [$countryCode, $countryName]; }