chintanlin/laravel-geoip2 is a Laravel package for the provider of geoip2 for laravel.
It currently has 1 GitHub stars and 8 downloads on Packagist (latest version v1.0.0).
Install it with composer require chintanlin/laravel-geoip2.
Discover more Laravel packages by chintanlin
or browse all Laravel packages to compare alternatives.
Last updated
GeoIP2 for Laravel
composer require chintanlin/laravel-geoip2
GeoIP2::getCountry('8.8.8.8'); // Facades
app('geoip2')->getCountry('8.8.8.8'); // Providers
geoip2('8.8.8.8'); // helpers
// use maxmind/GeoIP2 PHP API directly
$record = GeoIP2::city('8.8.8.8');
$record->country->name;
Database file store at storage_path('app/GeoLite2-City.mmdb')
ex : Laravel/storage/app/GeoLite2-City.mmdb
You should use your private license key in .env (MAXMIND_LICENSE=xxxx)
php artisan geoip2:update;