- As it is currently not published to packagist, you first need to reference this repo in the
composer.json
like so:
"repositories": [
{
"type": "git",
"url": "https://github.com/Hornet-Wing/laravel-geoip2"
}
]
- In order to install run the following composer command:
composer require talkative/laravel-geoip2
- Open your
config/app.php
and add the following to theproviders
array:
Talkative\LaravelGeoIP2\GeoIP2ServiceProvider::class,
- In the same config/app.php and add the following to the aliases array:
'GeoIP2' => Talkative\LaravelGeoIP2\GeoIP2Facade::class,
- Run the command below to publish the package:
$ php artisan vendor:publish --provider="Talkative\LaravelGeoIP2\GeoIP2ServiceProvider"
- Run the update command to download the latest required databases
$ php artisan geoip:update