PHPackages                             jetcod/ip-intelligence - 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. [Localization &amp; i18n](/categories/localization)
4. /
5. jetcod/ip-intelligence

ActiveLibrary[Localization &amp; i18n](/categories/localization)

jetcod/ip-intelligence
======================

A PHP package for geolocating IP addresses and obtaining locale and language information from them.

v1.0.0(2y ago)241MITPHPPHP ^7.3|^8.0

Since Sep 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jetcod/ip-intelligence)[ Packagist](https://packagist.org/packages/jetcod/ip-intelligence)[ RSS](/packages/jetcod-ip-intelligence/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (8)Versions (3)Used By (0)

IP-Intelligence
===============

[](#ip-intelligence)

[![Actions Status](https://github.com/jetcod/ip-intelligence/actions/workflows/php.yml/badge.svg?style=for-the-badge&label=%3Cb%3EBuild%3C/b%3E)](https://github.com/jetcod/ip-intelligence/actions)

[![Latest Stable Version](https://camo.githubusercontent.com/a565eef4a90f43326e9fcf08148cdaf11c0ec1e7c137b89d834585cff2392996/68747470733a2f2f706f7365722e707567782e6f72672f6a6574636f642f69702d696e74656c6c6967656e63652f763f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/jetcod/ip-intelligence)[![License](https://camo.githubusercontent.com/2e164a9943113891048490ae93beb94aae068160083d727177fbd2fa266f2354/687474703a2f2f706f7365722e707567782e6f72672f6a6574636f642f69702d696e74656c6c6967656e63652f6c6963656e73653f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/jetcod/ip-intelligence)

Overview
--------

[](#overview)

IP-Intelligence is a versatile PHP library designed for comprehensive IP address intelligence analysis. Powered by the robust MaxMind database and seamlessly integrated with the CLDR (Common Locale Data Repository) package, this library empowers you to extract a wealth of information from an IP address. Whether you need to uncover geolocation data, ASN (Autonomous System Number) information, or even detect the language and locale associated with an IP address, IP-Intelligence provides the essential tools to enrich your data analysis and decision-making processes.

Requirements
------------

[](#requirements)

This library requires:

- php7.4 or 8.0+
- Maxmind Db (available at [MaxMind Website](https://dev.maxmind.com/geoip))

Once you installed Maxmind Db you will have 3 database files as follows:

- GeoLite2-Country.mmdb
- GeoLite2-City.mmdb
- GeoLite2-ASN.mmdb

Keep the path to each file for further installation.

For comprehensive guidance on the installation procedure and requirements, kindly consult the [documentation website](https://jetcod.github.io/ip-intelligence/requirements.html).

Installation Guide
------------------

[](#installation-guide)

### Step1: Composer Installation

[](#step1-composer-installation)

Start by installing the IP-Intelligence package via Composer. Run the following command in your terminal:

```
composer require jetcod/ip-intelligence
```

This will fetch and install the necessary package files.

### Step 2: Configuration

[](#step-2-configuration)

IP-Intelligence requires configuration to work effectively. This library offers an artisan command tailored for Laravel projects, streamlining the installation and configuration of necessary databases. To kickstart this process, simply execute the following artisan command:

```
php artisan IpIntelligence:data-install
```

Throughout this setup, you will be prompted to specify the paths to the Maxmind databases, and the associated environment variables will be automatically configured.

If your project falls outside the Laravel framework, you should incorporate the `cldr-core` package by executing:

```
npm install cldr-core
```

Subsequently, make sure to define these variables within your `.env` file:

Usage
-----

[](#usage)

### IP Lookup

[](#ip-lookup)

The primary functionality of this library is to perform IP address lookups. You can obtain various details about an IP address using the ip() method. Here's an example of how to use it:

```
