barstec/ip-api
最新稳定版本:v1.1.1
Composer 安装命令:
composer require barstec/ip-api
包简介
Package for handling the ipapi.is API in Laravel
README 文档
README
A package for handling the ipapi.is API in Laravel. You will need an API key from ipapi.is.
Support
If this package is helpful to you, you can support my work on Ko-fi.
Installation
- Install composer package using command:
composer require barstec/ip-api
- Publish configuration files to your project
php artisan vendor:publish --provider="Barstec\IpApi\IpApiServiceProvider"
Setup
First, add an environment variable with your API key to the .env file:
IP_API_KEY=your_api_key
Usage
Create an IpApi object and call the get method. You can pass an IP address as a parameter. If left empty, the IP from the current request will be used. The result will be an stdClass.
Example of geting city location:
$ipApi = new IpApi; $result = $ipApi->get("8.8.8.8"); $result->location->city;
Author
License
This package is distributed under the MIT license
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-30