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.07k stars 372 forks source link

geoip() sometimes return empty ip data depending upon the system #216

Closed nag381 closed 2 years ago

nag381 commented 2 years ago

Hi @Torann

How are you? I am getting this weird issue. On local environment using maxmind_database I always get correct data for IP. On my live environment, most of the times I get correct results but sometimes I get empty values for the same IP. I have ensured that same geoip.mmdb file is used on both environments. I am using Laravel 8 running on PHP 8.

DStainback commented 2 years ago

The Maxmind database might be out of date. Also if you are using the free version, it doesn't support mobile very well, you might have to move to a paid version.

nag381 commented 2 years ago

Maxmind Database is fine. Sometimes geoip returns empty values and if you run geoip again it returns correct results.

nag381 commented 2 years ago

Closing this issue, as the issue is not in this package but with GeoIp2\Database\Reader as DB reader sometimes throws AddressNotFoundException other times it gets the correct results.