barstec/ip-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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.

ko-fi

Installation

  1. Install composer package using command:
  composer require barstec/ip-api
  1. 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

Bartłomiej Stec

License

This package is distributed under the MIT license

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-30