PHPackages                             d3catalyst/l4-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. d3catalyst/l4-geoip

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

d3catalyst/l4-geoip
===================

Laravel 4 Library for detecting geogpraphical location info.

1.0.1(11y ago)42.7k1[1 issues](https://github.com/D3Catalyst/laravel-4-geoip/issues)MITPHPPHP &gt;=5.3.7CI failing

Since Jul 29Pushed 11y ago3 watchersCompare

[ Source](https://github.com/D3Catalyst/laravel-4-geoip)[ Packagist](https://packagist.org/packages/d3catalyst/l4-geoip)[ Docs](http://laravel.d3catalyst.com/l4-geoip/)[ RSS](/packages/d3catalyst-l4-geoip/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

laravel-4-geoip
===============

[](#laravel-4-geoip)

[![Build Status](https://camo.githubusercontent.com/1f18440a515a7b185b8554cd19e3d757ef2347922826495b225eea5fa21556fa/68747470733a2f2f6170692e7472617669732d63692e6f72672f4433436174616c7973742f6c61726176656c2d342d67656f69702e737667)](https://travis-ci.org/D3Catalyst/laravel-4-geoip) [![Latest Stable Version](https://camo.githubusercontent.com/fd23df17df91669e2547f10b8a4af4728089419389ef29f746e92cd242ec9724/68747470733a2f2f706f7365722e707567782e6f72672f6433636174616c7973742f6c342d67656f69702f762f737461626c652e737667)](https://packagist.org/packages/d3catalyst/l4-geoip) [![Total Downloads](https://camo.githubusercontent.com/e178702863d12adee8cf9fe8863a35099e9077f83327b753c61dd45309d77b90/68747470733a2f2f706f7365722e707567782e6f72672f6433636174616c7973742f6c342d67656f69702f646f776e6c6f6164732e737667)](https://packagist.org/packages/d3catalyst/l4-geoip) [![Latest Unstable Version](https://camo.githubusercontent.com/de7fc05a7fbffdc400e42652524211284b7250db09124ff0a71779394475e25a/68747470733a2f2f706f7365722e707567782e6f72672f6433636174616c7973742f6c342d67656f69702f762f756e737461626c652e737667)](https://packagist.org/packages/d3catalyst/l4-geoip) [![License](https://camo.githubusercontent.com/98c09f66c4f2aa2a50ded8d2a183eeb3deea4eb27b6c84a86899d628859e7193/68747470733a2f2f706f7365722e707567782e6f72672f6433636174616c7973742f6c342d67656f69702f6c6963656e73652e737667)](https://packagist.org/packages/d3catalyst/l4-geoip) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/87ced11b2428bf2074fe7fdbf478c2cc9cf0c8062c5fc46a5eb6225f8d433ae3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4433436174616c7973742f6c61726176656c2d342d67656f69702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/D3Catalyst/laravel-4-geoip/?branch=master)

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)

```
Add in composer.json
"d3catalyst/l4-geoip": "dev-master"

```

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

Service Provider

```
D3Catalyst\GeoIP\Laravel4\ServiceProviders\GeoIPServiceProvider

```

Facade

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

```

Usage
=====

[](#usage)

Set IP of the visitor (Optional)

```
GeoIP::setIp("127.0.0.1");  // Optional set ip, when not set this take automatical from REMOTE_HOST

```

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 timezone of the visitor

```
GeoIP::getTimezone();  // returns "America/Mexico_City"

```

Get ISP of the visitor

```
GeoIP::getIsp();  // returns "Internet Service provider"

```

Get ALL geo information of visitor

```
GeoIP::getAll();  // returns array with all information

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

4302d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a5a0fb36baa59e88e6e67fb4049df8c3794ae237e1583de6fb8dfabcda293f7?d=identicon)[d3v1an](/maintainers/d3v1an)

---

Top Contributors

[![D3Catalyst](https://avatars.githubusercontent.com/u/6761108?v=4)](https://github.com/D3Catalyst "D3Catalyst (33 commits)")

---

Tags

geoipip to locationretrieve locationno local geodatabase requiredIp informationd3catalyst.com

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/d3catalyst-l4-geoip/health.svg)

```
[![Health](https://phpackages.com/badges/d3catalyst-l4-geoip/health.svg)](https://phpackages.com/packages/d3catalyst-l4-geoip)
```

###  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)[ipip/db

IPIP.net officially supported IP database ipdb format parsing library

139204.2k6](/packages/ipip-db)[adrianorosa/laravel-geolocation

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

6593.3k1](/packages/adrianorosa-laravel-geolocation)[bobey/geoip2-geolite2-composer

This tiny repository aims to provide an easy solution to require GeoIP2 / GeoLite2 databases inside your project using composer.

17838.7k1](/packages/bobey-geoip2-geolite2-composer)

PHPackages © 2026

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