diff --git a/src/Location.php b/src/Location.php index 45b94c9..b652228 100644 --- a/src/Location.php +++ b/src/Location.php @@ -21,6 +21,7 @@ * @property string|null $timezone * @property string|null $continent * @property string|null $currency + * @property object|null $raw * @property bool $default * @property bool $cached * diff --git a/src/Services/IPApi.php b/src/Services/IPApi.php index e76e3b1..161168c 100644 --- a/src/Services/IPApi.php +++ b/src/Services/IPApi.php @@ -35,7 +35,7 @@ public function boot() 'User-Agent' => 'Laravel-GeoIP', ], 'query' => [ - 'fields' => 49663, + 'fields' => $this->config('fields', 49663), 'lang' => $this->config('lang', ['en']), ], ]; @@ -87,6 +87,7 @@ public function locate($ip) 'lon' => $json->lon, 'timezone' => $json->timezone, 'continent' => $this->getContinent($json->countryCode), + 'raw' => $json, ]); } diff --git a/src/Services/IPData.php b/src/Services/IPData.php index 1376c94..2e03d16 100644 --- a/src/Services/IPData.php +++ b/src/Services/IPData.php @@ -63,6 +63,7 @@ public function locate($ip) 'timezone' => Arr::get($json, 'time_zone.name'), 'continent' => Arr::get($json, 'continent_code'), 'currency' => Arr::get($json, 'currency.code'), + 'raw' => $json, ]); } } diff --git a/src/Services/MaxMindDatabase.php b/src/Services/MaxMindDatabase.php index 180c672..2c84f5a 100644 --- a/src/Services/MaxMindDatabase.php +++ b/src/Services/MaxMindDatabase.php @@ -55,6 +55,7 @@ public function locate($ip) 'lon' => $record->location->longitude, 'timezone' => $record->location->timeZone, 'continent' => $record->continent->code, + 'raw' => $record, ]); } diff --git a/src/Services/MaxMindWebService.php b/src/Services/MaxMindWebService.php index 189f13f..f5f684a 100644 --- a/src/Services/MaxMindWebService.php +++ b/src/Services/MaxMindWebService.php @@ -46,6 +46,7 @@ public function locate($ip) 'lon' => $record->location->longitude, 'timezone' => $record->location->timeZone, 'continent' => $record->continent->code, + 'raw' => $record, ]); } } \ No newline at end of file