I'm trying to use the free MaxMind GeoLite2 code to be able to determine the country of a specific IP address.
I am using the Composer-free method that was posted here: Get a localized name of the users city via Maxmind GeoLite2 Free
I'm sure its incredibly simple, but I can't figure out how to actually pass an IP address and have it return the country.
After the $reader = new Reader...
line I have $place = $reader->country('##.###.##.###');
(where the #'s are actual IP address numbers) and it's not working. I tried replacing 'country' with 'city' and that didn't work either. I'm sure its something simple, I'm just not sure what parameters I need to be using to get the country returned.
The error that is shown in the error log is 'PHP Fatal error: Call to undefined method MaxMind\Db\Reader::city() in <<< path to benchmark.php >>>)'
Any ideas/suggestions would be greatly appreciated.