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

Returning default location every time #133

Open timothymarois opened 5 years ago

timothymarois commented 5 years ago

Not using the default geolite database. Using a paid version of geoip2 city database. Under the settings of maxmind_database. I wanted to like this package, but doesn't appear to work out of the box.

The download did work, the database is in the storage, but this package doesn't seem to read it at all. I am hardcoding my own public IP address from the ISP for testing. If I load my own geoip class to go directly into the database, works just fine.

Also, you should not use cache_tags on by default since the majority of us are either database or file-based caching. The first error I encountered.

timothymarois commented 5 years ago

Unfortunately, I can't use this package to extract location data. but I do like the self-update option for auto-download of the database. I will use that until this issue is fixed and run my own class for extracting location data.

campope commented 5 years ago

This is because the paid url is downloading a tar.gz folder in his code he's assuming it's to the database file directly. Writing my own console command that will extract it and copy the file to the normal location made it work just fine again.

jedimdan commented 4 years ago

@campope if you take a look at the actual service, he does attempt to extract the gzip file, but it's somehow not extracting correctly. https://github.com/Torann/laravel-geoip/blob/8f54e1290fc1bcb931c5e0dec163b902945e7d88/src/Services/MaxMindDatabase.php#L85

Could you share the command that you wrote to make it work?