countryCode = $location->country_code; return $position; } protected function process($ip = null) { try { return $this->getCountry($ip); } catch (\Exception $e) { return false; } } private function getCountry($ip = null) { $country = Request::header('Cf-Ipcountry'); if (! is_null($country)) { $response = ['country_code' => $country]; return new Fluent($response); } return $this->fallback->get($ip ?: RequestHelper::ip()); } }