manka/geo-ip

A simple GeoIP package for Laravel to get location details from an IP address.

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/manka/geo-ip

v1.1.1 2025-06-06 16:28 UTC

This package is auto-updated.

Last update: 2025-12-06 17:52:12 UTC


README

Latest Version Total Downloads License

Laravel GeoIP is a simple package to retrieve geographical location data from an IP address using the ip-api.com API.

🔧 Installation

Install via Composer:

composer require manka/geo-ip


If you're using Laravel <5.5, you must manually register the service provider in config/app.php:

```php
'providers' => [
    // ...
    manka\GeoIP\GeoIPServiceProvider::class,
],

⚙️ Configuration Publish the configuration file (optional):

php artisan vendor:publish --tag=config

This will create a config/geoip.php file you can modify.

🚀 Usage Use the package like this:

use GeoIP;

$location = GeoIP::lookup(); // Uses current request IP
$customLocation = GeoIP::lookup('8.8.8.8'); // Pass a specific IP

dd($location);

Sample Output

{
    "status": "success",
    "country": "United States",
    "regionName": "California",
    "city": "Mountain View",
    "zip": "94043",
    "lat": 37.422,
    "lon": -122.084,
    "timezone": "America/Los_Angeles",
    "isp": "Google LLC",
    "query": "8.8.8.8"
}

✅ Features

  • Get geo location from IP address
  • Automatically detect current IP
  • Simple API, no setup required
  • Uses public API (ip-api.com)

Developed with ❤️ by Pawan Manka