drongotech / iplocationmanager
使用IP堆栈获取请求IP并保存IP元数据
v1.0.7
2022-07-17 13:56 UTC
Requires (Dev)
- laravel/framework: ^9.0
- laravel/tinker: ^2.7
README
IP位置管理器使用Ipstack来查找客户端IP地址。数据包括:
ip: "xxx.xxx.xxx.xxx" 类型: "ipv4" 大洲代码: "AF" 大洲名称: "非洲" 国家代码: "KE" 国家名称: "肯尼亚" 地区代码: "30" 地区名称: "内罗毕地区" 城市: "内罗毕" 邮编: 00001 ...... 查看更多
要安装
composer require drongotech/iplocationmanager
php artisan vendor:publish --tag=dt-config
php artisan vendor:publish --tag=dt-migrations
php artisan migrate
在项目中的任何位置添加日志IP数据,使用以下方式:
use Drongotech\Events\Iplocationmanager\LogIpEvent;
LogIpEvent::dispatch([]);