PHPackages                             furey-imagination/laravel4-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. furey-imagination/laravel4-geoip

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

furey-imagination/laravel4-geoip
================================

Determine the geographical location of website visitors based on their IP address.

0.1.2(11y ago)0922BSD 2-ClausePHPPHP &gt;=5.3.0

Since Dec 12Pushed 11y agoCompare

[ Source](https://github.com/furey-imagination/laravel4-geoip)[ Packagist](https://packagist.org/packages/furey-imagination/laravel4-geoip)[ RSS](/packages/furey-imagination-laravel4-geoip/feed)WikiDiscussions laravel4 Synced 1w ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

GeoIP for Laravel 4
===================

[](#geoip-for-laravel-4)

[![Latest Stable Version](https://camo.githubusercontent.com/b4c14a8e89fbb6b35a4ec178cffcdb93c48093b3e4d9cae15b1f1ef93baa9566/68747470733a2f2f706f7365722e707567782e6f72672f746f72616e6e2f67656f69702f762f737461626c652e706e67)](https://packagist.org/packages/torann/geoip) [![Total Downloads](https://camo.githubusercontent.com/b8537b5c4fa2664d4f542c6a974277ca0b9db5666d854a1346959c541f8b29d4/68747470733a2f2f706f7365722e707567782e6f72672f746f72616e6e2f67656f69702f646f776e6c6f6164732e706e67)](https://packagist.org/packages/torann/geoip)

Determine the geographical location of website visitors based on their IP addresses.

---

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

[](#installation)

- [GeoIP for Laravel 4 on Packagist](https://packagist.org/packages/torann/geoip)
- [GeoIP for Laravel 4 on GitHub](https://github.com/torann/laravel-hashids)

To get the latest version of GeoIP simply require it in your `composer.json` file.

```
"furey-imagination/laravel4-geoip": "0.1.*"

```

You'll then need to run `composer install` to download it and have the autoloader updated.

Once GeoIP is installed you need to register the service provider with the application. Open up `app/config/app.php` and find the `providers` key.

```
'providers' => array(

    'Torann\GeoIP\GeoIPServiceProvider',

)
```

GeoIP also ships with a facade which provides the static syntax for creating collections. You can register the facade in the `aliases` key of your `app/config/app.php` file.

```
'aliases' => array(

    'GeoIP' => 'Torann\GeoIP\GeoIPFacade',

)
```

Create configuration file using artisan

```
$ php artisan config:publish furey-imagination/laravel4-geoip

```

Usage
-----

[](#usage)

Get the location data for a website visitor:

```
$location = GeoIP::getLocation();
```

> When an IP is not given the `$_SERVER["REMOTE_ADDR"]` is used.

Getting the location data for a given IP:

```
$location = GeoIP::getLocation( '232.223.11.11' );
```

### Example Data

[](#example-data)

```
array (
    "ip"           => "232.223.11.11",
    "isoCode"      => "US",
    "country"      => "United States",
    "city"         => "New Haven",
    "state"        => "CT",
    "postal_code"  => "06510",
    "lat"          => 41.28,
    "lon"          => -72.88,
    "timezone"     => "America/New_York",
    "continent"    => "NA",
    "default"      => false
);
```

#### Note

[](#note)

In the case that a location is not found the fallback location will be returned with the `default` parameter set to `true`. In a future release I'll make the default location customizable. For not it is New Haven, CT.

Services
--------

[](#services)

### [MaxMind](http://www.maxmind.com)

[](#maxmind)

- **Database Service**: To use the database version of MaxMind services download the `GeoLite2-City.mmdb` from  and extract it to `/app/database/maxmind/`. And that's it.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~230 days

Total

3

Last Release

4080d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10556642?v=4)[James Furey](/maintainers/furey-imagination)[@furey-imagination](https://github.com/furey-imagination)

---

Top Contributors

[![Torann](https://avatars.githubusercontent.com/u/1406755?v=4)](https://github.com/Torann "Torann (15 commits)")[![furey-imagination](https://avatars.githubusercontent.com/u/10556642?v=4)](https://github.com/furey-imagination "furey-imagination (7 commits)")[![kyranb](https://avatars.githubusercontent.com/u/5426926?v=4)](https://github.com/kyranb "kyranb (3 commits)")[![LukeT](https://avatars.githubusercontent.com/u/2203091?v=4)](https://github.com/LukeT "LukeT (2 commits)")

---

Tags

laravelgeoipgeolocationlocationlaravel4

### Embed Badge

![Health badge](/badges/furey-imagination-laravel4-geoip/health.svg)

```
[![Health](https://phpackages.com/badges/furey-imagination-laravel4-geoip/health.svg)](https://phpackages.com/packages/furey-imagination-laravel4-geoip)
```

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[torann/geoip

Support for multiple Geographical Location services.

2.2k14.2M76](/packages/torann-geoip)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[adrianorosa/laravel-geolocation

Laravel Geo Location package to get details for a given IP Address

6593.3k1](/packages/adrianorosa-laravel-geolocation)[pulkitjalan/ip-geolocation

IP Geolocation Wrapper with Laravel Support

89164.9k1](/packages/pulkitjalan-ip-geolocation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
