manka/geo-ip
最新稳定版本:v1.1.1
Composer 安装命令:
composer require manka/geo-ip
包简介
A simple GeoIP package for Laravel to get location details from an IP address.
README 文档
README
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
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2025-06-06