Download the PHP package riteshptl21/geoip without Composer
On this page you can find all versions of the php package riteshptl21/geoip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download riteshptl21/geoip
More information about riteshptl21/geoip
Files in riteshptl21/geoip
Package geoip
Short Description Supports Maxmind GeoIP services
License BSD 2-Clause
Informations about the package geoip
Maxmind GeoIP2 API For Laravel 4.2
Description
Geoip is a Laravel package that aims to seamlessly integrate MaxMind functionality for determine the geographical location of IP addresses in laravel.
Installation
Add geoip to your composer.json file:
You'll then need to run composer install
to download it and have the autoloader updated.
Add the service provider to your Laravel application config:
Create configuration file using artisan
$ php artisan config:publish riteshptl21/geoip
Once you fire this command you see config file at app/config/packages/riteshptl21/geoip/config.php
and set config at there.
- Database Service: To use the database version of MaxMind services download the
GeoLite2-City.mmdb
from http://dev.maxmind.com/geoip/geoip2/geolite2/ extract it and set file path ofGeoLite2-City.mmdb
asdatabase_path
at config file. - Web Service: To use the web service version of MaxMind services Please create account at https://www.maxmind.com/en/geoip2-precision-services and set config.
Usage
Get the location data for a website visitor:
When an IP is not given the
$_SERVER["REMOTE_ADDR"]
is used.
Getting the location data for a given IP:
Note
In the case that a location is not found the fallback location will be returned with the default_location
parameter that you set in config.By default default_location is like as under: