PHPackages                             buonzz/laravel-4-freegeoip - 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. buonzz/laravel-4-freegeoip

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

buonzz/laravel-4-freegeoip
==========================

Laravel 4 Library for detecting geogpraphical location info of your visitors

v1.0.3(11y ago)146.5k12[5 issues](https://github.com/buonzz/laravel-4-freegeoip/issues)[1 PRs](https://github.com/buonzz/laravel-4-freegeoip/pulls)1MITPHPPHP &gt;=5.3.7

Since Apr 19Pushed 11y ago1 watchersCompare

[ Source](https://github.com/buonzz/laravel-4-freegeoip)[ Packagist](https://packagist.org/packages/buonzz/laravel-4-freegeoip)[ Docs](http://www.darwinbiler.com/laravel-4-freegeoip/docs/v1.0.1)[ RSS](/packages/buonzz-laravel-4-freegeoip/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (3)Versions (5)Used By (1)

FreeGeoIP for Laravel 4
=======================

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

[![Build Status](https://camo.githubusercontent.com/248c7b46f87f74e68dbcf7c11a26ed1cd4fdcfa70fee17f3e85d96bc98a9899b/68747470733a2f2f7472617669732d63692e6f72672f62756f6e7a7a2f6c61726176656c2d342d6672656567656f69702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/buonzz/laravel-4-freegeoip)[![Latest Stable Version](https://camo.githubusercontent.com/d66efe9d7871346cdc34ce5792a572e5df974cd5b98a2833bd81162c96d92678/68747470733a2f2f706f7365722e707567782e6f72672f62756f6e7a7a2f6c61726176656c2d342d6672656567656f69702f762f737461626c652e737667)](https://packagist.org/packages/buonzz/laravel-4-freegeoip) [![Total Downloads](https://camo.githubusercontent.com/0eb25fe360fb9762bc30b3c712edcf60fc800cbdf0507feda95d9c4aaeb0ea44/68747470733a2f2f706f7365722e707567782e6f72672f62756f6e7a7a2f6c61726176656c2d342d6672656567656f69702f646f776e6c6f6164732e737667)](https://packagist.org/packages/buonzz/laravel-4-freegeoip)[![Latest Unstable Version](https://camo.githubusercontent.com/66feb17ff31fe4e7075013f2c0dc5ab31def90c588f26ae4f04532df3803a085/68747470733a2f2f706f7365722e707567782e6f72672f62756f6e7a7a2f6c61726176656c2d342d6672656567656f69702f762f756e737461626c652e737667)](https://packagist.org/packages/buonzz/laravel-4-freegeoip) [![License](https://camo.githubusercontent.com/b70c29b8d4186837cd5470714a8f7a7b99b7f69c1fa5c851de8138c78384cbef/68747470733a2f2f706f7365722e707567782e6f72672f62756f6e7a7a2f6c61726176656c2d342d6672656567656f69702f6c6963656e73652e737667)](https://packagist.org/packages/buonzz/laravel-4-freegeoip)

Laravel 4 Library for calling  API.

In contrary to all other packages wherein it requires that you have the geoip database in your filesystem, this library calls a free service So you dont really have to worry about downloading and maintaining geoip data from Maxmind in your own server.

Just install the package, add the config and it is ready to use!

Requirements
============

[](#requirements)

- PHP &gt;= 5.3.7
- cURL Extension

Installation
============

[](#installation)

```
composer require buonzz/laravel-4-freegeoip:dev-master

```

Add the service provider and facade in your config/app.php

Service Provider

```
Buonzz\GeoIP\Laravel4\ServiceProviders\GeoIPServiceProvider

```

Facade

```
'GeoIP'            => 'Buonzz\GeoIP\Laravel4\Facades\GeoIP',

```

Configuration
=============

[](#configuration)

This library supports optional configuration.

To get started, first publish the package config file:

```
$ php artisan config:publish buonzz/laravel-4-freegeoip
```

- `freegeopipURL`: defines the URL of the FreeGeoIP API. Use HTTPS or not. Default to `http://www.freegeoip.net/json/`.
- `timeout`: defines the timeout when calling the FreeGeoIP API (in seconds). Default to 30.

Usage
=====

[](#usage)

Get country of the visitor

```
GeoIP::getCountry();  // returns "United States"

```

Get country code of the visitor

```
GeoIP::getCountryCode();  // returns "US"

```

Get region of the visitor

```
GeoIP::getRegion();  // returns "New York"

```

Get region code of the visitor

```
GeoIP::getRegionCode();  // returns "NY"

```

Get city of the visitor

```
GeoIP::getCity();  // returns "Buffalo"

```

Get zip code of the visitor

```
GeoIP::getZipCode();  // returns "14221"

```

Get latitude of the visitor

```
GeoIP::getLatitude();  // returns "42.9864"

```

Get longitude of the visitor

```
GeoIP::getLongitude();  // returns "-78.7279"

```

Get metro code of the visitor

```
GeoIP::getMetroCode();  // returns "514"

```

Get area code of the visitor

```
GeoIP::getAreaCode();  // returns "716"

```

Credits
=======

[](#credits)

- Alexandre Fiori for the awesome  web api
- MaxMind for the data

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 63.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 ~88 days

Total

4

Last Release

4142d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ace28ed0f8f9067b0083c1cdce556c1b183d91d8cf2ef65a01736fe1c1464782?d=identicon)[buonzz](/maintainers/buonzz)

---

Top Contributors

[![buonzz](https://avatars.githubusercontent.com/u/946233?v=4)](https://github.com/buonzz "buonzz (21 commits)")[![paperdarwin](https://avatars.githubusercontent.com/u/5999388?v=4)](https://github.com/paperdarwin "paperdarwin (6 commits)")[![AntoineAugusti](https://avatars.githubusercontent.com/u/295709?v=4)](https://github.com/AntoineAugusti "AntoineAugusti (3 commits)")[![osugregor](https://avatars.githubusercontent.com/u/781984?v=4)](https://github.com/osugregor "osugregor (2 commits)")[![closca](https://avatars.githubusercontent.com/u/4892901?v=4)](https://github.com/closca "closca (1 commits)")

---

Tags

geoipmapsip to locationfreegeoip.nettrack locationretrieve locationno local geodatabase required

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/buonzz-laravel-4-freegeoip/health.svg)

```
[![Health](https://phpackages.com/badges/buonzz-laravel-4-freegeoip/health.svg)](https://phpackages.com/packages/buonzz-laravel-4-freegeoip)
```

###  Alternatives

[torann/geoip

Support for multiple Geographical Location services.

2.2k14.2M76](/packages/torann-geoip)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[willdurand/geocoder

Common files for PHP Geocoder

17435.7M159](/packages/willdurand-geocoder)[cornford/googlmapper

An easy way to integrate Google Maps with Laravel.

457447.9k4](/packages/cornford-googlmapper)[emcconville/google-map-polyline-encoding-tool

A simple class to handle polyline-encoding for Google Maps

1572.3M2](/packages/emcconville-google-map-polyline-encoding-tool)[mediawiki/maps

Adds various mapping features to MediaWiki

84145.0k3](/packages/mediawiki-maps)

PHPackages © 2026

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