Skip to content

NBZ4live/laravel-geoip2

Repository files navigation

GeoIP2 for Laravel 5.4-5.5

Note: For Laravel 5.2-5.3 use version tagged 1.1.5

Installation

  1. 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"
	}
]
  1. In order to install run the following composer command:
composer require talkative/laravel-geoip2
Laravel 5.5 Install skip to step 4.
  1. Open your config/app.php and add the following to the providers array:
Talkative\LaravelGeoIP2\GeoIP2ServiceProvider::class,
  1. In the same config/app.php and add the following to the aliases array:
'GeoIP2' => Talkative\LaravelGeoIP2\GeoIP2Facade::class,
  1. Run the command below to publish the package:
$ php artisan vendor:publish --provider="Talkative\LaravelGeoIP2\GeoIP2ServiceProvider"
  1. Run the update command to download the latest required databases
$ php artisan geoip:update