Download the PHP package jetcod/ip-intelligence without Composer
On this page you can find all versions of the php package jetcod/ip-intelligence. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jetcod/ip-intelligence
More information about jetcod/ip-intelligence
Files in jetcod/ip-intelligence
Package ip-intelligence
Short Description A PHP package for geolocating IP addresses and obtaining locale and language information from them.
License MIT
Informations about the package ip-intelligence
IP-Intelligence
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
This library requires:
- php7.4 or 8.0+
- Maxmind Db (available at MaxMind Website)
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.
Installation Guide
Step1: Composer Installation
Start by installing the IP-Intelligence package via Composer. Run the following command in your terminal:
This will fetch and install the necessary package files.
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:
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:
Subsequently, make sure to define these variables within your .env
file:
Usage
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:
This code demonstrates how to initialize the IpLookup class, perform an IP lookup, and retrieve information about the given IP address, including language, city, and country details. Be sure to handle exceptions as shown in the code to gracefully manage errors that may arise during the lookup process.
Language
The Language
class is a component of the Jetcod IP Intelligence library and is designed to provide information about languages spoken in a specific country based on CLDR (Common Locale Data Repository) data. This class allows you to retrieve details about the languages, official languages, and the locale associated with a given country code.
Here is the usage example:
This usage example demonstrates how to create a Language instance, switch the country, and retrieve language information for that country. It also handles exceptions that may occur during the process.
Contributing
If you would like to contribute to this library, please fork the repository and submit a pull request. We welcome bug fixes, feature requests, and other contributions.
License
This library is released under the MIT License. Please see the LICENSE file for more information.
All versions of ip-intelligence with dependencies
symfony/dotenv Version ^5.4
ext-intl Version *
php Version ^7.3|^8.0
laravel/framework Version >6.0