- In order to install run the following composer command:
composer require nbz4live/laravel-geoip2
- Open your
config/app.php
and add the following to theproviders
array:
Nbz4live\LaravelGeoIP2\ServiceProvider::class,
- In the same config/app.php and add the following to the aliases array:
'GeoIP2' => Nbz4live\LaravelGeoIP2\Facades\GeoIP2::class,
- You can publish the config file by running (optional):
$ php artisan vendor:publish --provider="Nbz4live\LaravelGeoIP2\ServiceProvider"
- Run the update command to download the latest required databases
$ php artisan geoip:update