Torann / laravel-geoip

Determine the geographical location of website visitors based on their IP addresses.
http://lyften.com/projects/laravel-geoip
BSD 2-Clause "Simplified" License
2.1k stars 373 forks source link

Error in docs for create return data from new service #140

Open yushkevichv opened 5 years ago

yushkevichv commented 5 years ago

Hi

At docs return value in locate method is array, but it is incorrect. If we return array, we catch exception in GeoIP class. Also, in your implementation for some services, you use hydrate.

In docs it should be

return $this->hydrate([
            'ip' => $ip,
            'iso_code' => $json->iso_code,
            'country' => $json->country,
            'city' => $json->city,
            'state' => $json->state,
            'state_name' => $json->state_name,
            'postal_code' => $json->postal_code,
            'lat' => $json->lat,
            'lon' => $json->lon,
            'timezone' => $json->timezone,
            'continent' => $json->continent,
])