Download the PHP package danielme85/laravel-geoip2 without Composer
On this page you can find all versions of the php package danielme85/laravel-geoip2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download danielme85/laravel-geoip2
More information about danielme85/laravel-geoip2
Files in danielme85/laravel-geoip2
Package laravel-geoip2
Short Description Service provider and DB downloader for Maxminds PHP API GeoIP2.
License MIT
Informations about the package laravel-geoip2
laravel-geoip2
Laravel 5+ Service provider and DB downloader for Maxminds PHP API GeoIP2. https://github.com/maxmind/GeoIP2-php
Per Jan 2020 you now have to create an account at MaxMind and get a "license key". It is still free of charge per now.
https://dev.maxmind.com/geoip/geoip2/geolite2/
Install
In composer.json
or command: composer require danielme85/laravel-geoip2
Add your geoip licence to your env file:
Laravel 5.x
Add to your config/app.php under Service Providers
(If you use Laravel 5.5+ you could skip this step as Autodiscovery has been enabled for this package.)
Lumen 5.x
Add to your boostrap/app.php file
Config
Publish the config file to your Laravel projects
The following default settings will work right away:
Usage
You need to download the Maxmind Geoip first, the default config is for the city version (about 30MB download, 50MB extracted).
With the DB file downloaded you are ready to get some location data:
Usage once you have the Reader:connect object is the same as maxminds documentation https://github.com/maxmind/GeoIP2-php.
Example usage, return json location data based on ipv4 address.
This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com
All versions of laravel-geoip2 with dependencies
guzzlehttp/guzzle Version >=6.0
geoip2/geoip2 Version ~2.0