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

ActiveLibrary

webklex/laravel-geoip
=====================

Laravel GeoIP client

1.0.1(5y ago)1101MITPHPPHP &gt;=5.5.9

Since Oct 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Webklex/laravel-geoip)[ Packagist](https://packagist.org/packages/webklex/laravel-geoip)[ Docs](https://github.com/webklex/laravel-geoip)[ RSS](/packages/webklex-laravel-geoip/feed)WikiDiscussions master Synced 2d ago

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

GeoIP Library for Laravel
=========================

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/f04a2215e6c9c816f19609194f430b14859ab9dad25e1006bfa5b7d182d87ab8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f5765626b6c65782f6c61726176656c2d67656f69702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Webklex/laravel-geoip)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/Webklex/laravel-geoip/blob/master/LICENSE)[![Build Status](https://camo.githubusercontent.com/fcd3b93a14cf69c6ab73ba93803d616dd47a0e8263c36485d6e1bbc4cff8dcb9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f5765626b6c65782f6c61726176656c2d67656f69702f6d61737465723f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Webklex/laravel-geoip/code-structure)[![Total Downloads](https://camo.githubusercontent.com/382b5d60491b1e9fdf4245c74c4ae06bcc49813c99dc6e7fe70b6d7c090a84f4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f5765626b6c65782f6c61726176656c2d67656f69702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Webklex/laravel-geoip)[![Hits](https://camo.githubusercontent.com/d6fe1227cd9bae3ed7e9b3adbb84ba87d2a1277b6c7ea27b761654eef72af755/68747470733a2f2f686974732e7765626b6c65782e636f6d2f7376672f7765626b6c65782f6c61726176656c2d67656f6970)](https://hits.webklex.com)

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

[](#description)

Laravel-GeoIP provides you with the ability to gather open source ip intelligence by using the open api provided by [GoGeoIP](https://github.com/Webklex/gogeoip).

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Basic usage example](#basic-usage-example)
- [Support](#support)
- [Security](#security)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

1.) Install the Laravel-GeoIP package by running the following command:

```
composer require webklex/laravel-geoip
```

2.) If you're using Laravel &gt;= 5.5, package discovery will configure the service provider and `GeoIP` alias out of the box. Otherwise, for Laravel &lt;= 5.4, edit your `config/app.php` file and:

- add the following to the `providers` array:

```
\Webklex\LaravelGeoIP\Providers\GeoIPServiceProvider::class,
```

- add the following to the `aliases` array:

```
'GeoIP' => \Webklex\LaravelGeoIP\Facades\GeoIP::class,
```

3.) Run the command below to publish the package config file [config/geoip.php](src/config/geoip.php):

```
php artisan vendor:publish --provider="Webklex\LaravelGeoIP\Providers\GeoIPServiceProvider"
```

Usage
-----

[](#usage)

#### Basic usage example

[](#basic-usage-example)

This is a basic example, which will dump the geoip information for the current user ip as well as for the ip "205.13.135.36".

```
use Webklex\LaravelGeoIP\Facades\GeoIP;

var_dump(GeoIP::current());
var_dump(GeoIP::get("205.13.135.36"));
```

If you want to use your own instance of [GoGeoIP](https://github.com/Webklex/gogeoip), just update the endpoint provided in the config file.

#### Response:

[](#response)

```
{
  "network": {
    "ip": "208.13.138.36",
    "as": {
      "number": 209,
      "name": "CenturyLink Communications, LLC"
    },
    "isp": "",
    "domain": "",
    "tld": [".us"],
    "bot": false,
    "tor": false,
    "proxy": false,
    "proxy_type": "",
    "last_seen": 0,
    "usage_type": ""
  },
  "location": {
    "region_code": "NV",
    "region_name": "",
    "city": "Las Vegas",
    "zip_code": "89129",
    "time_zone": "America/Los_Angeles",
    "longitude": -115.2821,
    "latitude": 36.2473,
    "accuracy_radius": 20,
    "metro_code": 839,
    "country": {
      "code": "US",
      "cioc": "USA",
      "ccn3": "840",
      "call_code": ["1"],
      "international_prefix": "011",
      "capital": "Washington D.C.",
      "name": "United States",
      "full_name": "United States of America",
      "area": 9372610,
      "borders": ["CAN", "MEX"],
      "latitude": 39.443256,
      "longitude": -98.95734,
      "max_latitude": 71.441055,
      "max_longitude": -66.885414,
      "min_latitude": 17.831509,
      "min_longitude": -179.23108,
      "currency": [{
          "code": "USD",
          "name": ""
       }, {
          "code": "USN",
          "name": ""
       }, {
          "code": "USS",
          "name": ""
      }],
      "continent": {
        "code": "",
        "name": "North America",
        "sub_region": ""
      }
    }
  }
}
```

Support
-------

[](#support)

If you encounter any problems or if you find a bug, please don't hesitate to create a new [issue](https://github.com/Webklex/laravel-geoip/issues). However please be aware that it might take some time to get an answer. Off topic, rude or abusive issues will be deleted without any notice.

If you need **immediate** or **commercial** support, feel free to send me a mail at .

##### A little notice

[](#a-little-notice)

If you write source code in your issue, please consider to format it correctly. This makes it so much nicer to read and people are more likely to comment and help :)

``` php

echo 'your php code...';

```

will turn into:

```
echo 'your php code...';
```

### Features &amp; pull requests

[](#features--pull-requests)

Everyone can contribute to this project. Every pull request will be considered but it can also happen to be declined. To prevent unnecessary work, please consider to create a [feature issue](https://github.com/Webklex/laravel-geoip/issues/new?template=feature_request.md)first, if you're planning to do bigger changes. Of course you can also create a new [feature issue](https://github.com/Webklex/laravel-geoip/issues/new?template=feature_request.md)if you're just wishing a feature ;)

Change log
----------

[](#change-log)

Please see [CHANGELOG](https://github.com/Webklex/laravel-geoip/blob/master/CHANGELOG.md) for more information what has changed recently.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Webklex](https://github.com/webklex)
- [All Contributors](https://github.com/Webklex/laravel-geoip/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/Webklex/laravel-geoip/blob/master/LICENSE) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

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 ~0 days

Total

2

Last Release

2033d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33ae6b4339438c4901fa8ed581119bbca61d071907f308ea8e9af597ae69f08a?d=identicon)[webklex](/maintainers/webklex)

---

Top Contributors

[![Webklex](https://avatars.githubusercontent.com/u/2884144?v=4)](https://github.com/Webklex "Webklex (3 commits)")

---

Tags

laravelgeoipIPwebklexlaravel-geoip

### Embed Badge

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

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

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[webklex/laravel-git-hook

Laravel Git Hook

191.2k](/packages/webklex-laravel-git-hook)

PHPackages © 2026

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