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

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

riteshptl21/geoip
=================

Supports Maxmind GeoIP services

0.1.2.1(9y ago)014BSD 2-ClausePHPPHP &gt;=5.4.0

Since Feb 17Pushed 4y ago2 watchersCompare

[ Source](https://github.com/riteshptl21/geoip)[ Packagist](https://packagist.org/packages/riteshptl21/geoip)[ RSS](/packages/riteshptl21-geoip/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Maxmind GeoIP2 API For Laravel 4.2
==================================

[](#maxmind-geoip2-api-for-laravel-42)

Description
-----------

[](#description)

[![Latest Stable Version](https://camo.githubusercontent.com/42fff718b3b454800c87ce2891285a42de684f5eabab8445bbe48b7e7cb1aa7e/68747470733a2f2f706f7365722e707567782e6f72672f72697465736870746c32312f67656f69702f762f737461626c65)](https://packagist.org/packages/riteshptl21/geoip) [![Total Downloads](https://camo.githubusercontent.com/2bbe6981917837214e008ea5009f43bb42d877bd8284f6b1f2495303b2ab08d8/68747470733a2f2f706f7365722e707567782e6f72672f72697465736870746c32312f67656f69702f646f776e6c6f616473)](https://packagist.org/packages/riteshptl21/geoip)

Geoip is a Laravel package that aims to seamlessly integrate MaxMind functionality for determine the geographical location of IP addresses in laravel.

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

[](#installation)

Add geoip to your composer.json file:

`"riteshptl21/geoip": "0.1.*"`

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:

```
'Riteshptl21\Geoip\GeoipServiceProvider'
```

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  extract it and set file path of `GeoLite2-City.mmdb` as `database_path` at config file.
- **Web Service**: To use the web service version of MaxMind services Please create account at  and set config.

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( '2.24.234.19' );
```

#### Note

[](#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:

```
array (
    "ip"            => "127.0.0.0",
    "isoCode"       => "IN",
    "country"       => "India",
    "city"          => "Ahmedabad",
    "state_code"    => "GJ",
    "postal_code"   => "261201",
    "lat"           => 23.0333,
    "lon"           => 72.6167,
    "timezone"      => "Asia/Kolkata",
    "continent"     => "AS",
    "default"       => true
)
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

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

Every ~83 days

Total

3

Last Release

3620d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8054729?v=4)[Ritesh Patel](/maintainers/riteshptl21)[@riteshptl21](https://github.com/riteshptl21)

---

Top Contributors

[![riteshptl21](https://avatars.githubusercontent.com/u/8054729?v=4)](https://github.com/riteshptl21 "riteshptl21 (10 commits)")

---

Tags

laravelgeoipgeolocationmaxmindlocationlaravel4

### Embed Badge

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

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

###  Alternatives

[torann/geoip

Support for multiple Geographical Location services.

2.2k14.9M92](/packages/torann-geoip)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k8.2M84](/packages/stevebauman-location)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

19253.0k3](/packages/interaction-design-foundation-laravel-geoip)[pulkitjalan/ip-geolocation

IP Geolocation Wrapper with Laravel Support

91194.7k1](/packages/pulkitjalan-ip-geolocation)[hibit-dev/geodetect

Automatically detect user's geo data based on their IP address

2321.5k](/packages/hibit-dev-geodetect)

PHPackages © 2026

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