PHPackages                             macromindonline/geoip - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. macromindonline/geoip

ActiveLibrary[API Development](/categories/api)

macromindonline/geoip
=====================

Geoip Wrapper with Laravel 4 &amp; 5 Support

2.5.0(9y ago)07MITPHPPHP &gt;=5.5

Since Jan 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/macromindonline/geoip)[ Packagist](https://packagist.org/packages/macromindonline/geoip)[ Docs](https://github.com/pulkitjalan/geoip)[ RSS](/packages/macromindonline-geoip/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (23)Used By (0)

GeoIP
=====

[](#geoip)

> Geoip Wrapper with Laravel 4 &amp; 5 Support

[![Build Status](https://camo.githubusercontent.com/517a53a50284edbda65665f3894ef06fb30e153e11c3014a13a98ae5e26e8bec/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f70756c6b69746a616c616e2f67656f69702f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/pulkitjalan/geoip)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/bf6d09ce4bca450fbc8d76d28e02f28ae938c8bca851da7680a21bf8f5fb473f/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f70756c6b69746a616c616e2f67656f69702f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/pulkitjalan/geoip/)[![Coverage Status](https://camo.githubusercontent.com/698821793675ce6a5ba33cdca2ae91036b758aeba6a8da4b6a5ab5795b7a638b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f70756c6b69746a616c616e2f67656f69702f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/pulkitjalan/geoip/code-structure/master)[![License](https://camo.githubusercontent.com/30597ff9a350144f03bffdd9183e16468e0b3ca1193e1d08591d992622738d55/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://www.opensource.org/licenses/MIT)[![Latest Version](https://camo.githubusercontent.com/e11c0a1787a2df96dfe4ea27ff9da115745b8876a39447920d6b9522cb65f2f1/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70756c6b69746a616c616e2f67656f69702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pulkitjalan/geoip)[![Total Downloads](https://camo.githubusercontent.com/d17458aee2083b0462ac51eedb4a7ea39788f1b60b3907a55016149d751a8a5c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70756c6b69746a616c616e2f67656f69702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pulkitjalan/geoip)

Supported Drivers ([Services](#services))
-----------------------------------------

[](#supported-drivers-services)

- [FreeGeoIP](https://freegeoip.net/)
- [IP-API](http://ip-api.com/)
- [Maxmind](https://www.maxmind.com/)
- [Telize](https://market.mashape.com/fcambus/telize/)

Requirements
------------

[](#requirements)

- PHP &gt;= 5.5

Installation
------------

[](#installation)

Install via composer - edit your `composer.json` to require the package.

```
"require": {
    "pulkitjalan/geoip": "2.*"
}
```

Then run `composer update` in your terminal to pull it in.

### Laravel

[](#laravel)

There is a Laravel service provider and facade available.

Add the following to the `providers` array in your `config/app.php`

```
PulkitJalan\GeoIP\GeoIPServiceProvider::class
```

Next add the following to the `aliases` array in your `config/app.php`

```
'GeoIP' => PulkitJalan\GeoIP\Facades\GeoIP::class
```

Next run `php artisan vendor:publish --provider="PulkitJalan\GeoIP\GeoIPServiceProvider" --tag="config"` to publish the config file.

#### Looking for a Laravel 4 compatible version?

[](#looking-for-a-laravel-4-compatible-version)

Checkout the [1.0 branch](https://github.com/pulkitjalan/geoip/tree/1.0)

Usage
-----

[](#usage)

The geoip class takes a config array as the first parameter or defaults to using the `ip-api` driver.

Example:

```
