alfa-dev-team/abstractapi-geo

abstractapi-geo 的描述。

1.0 2022-04-19 15:47 UTC

This package is auto-updated.

Last update: 2024-09-19 21:34:21 UTC


README

Software License Travis Total Downloads

安装

composer require alfa-dev-team/abstractapi-geo

php artisan vendor:publish --provider="AlfaDevTeam\AbstractapiGeo\AbstractapiGeoServiceProvider" --tag="migrations"

使用

将参数 ABSTRACTAPI_IP_GEOLOCATION_API_KEY= 添加到 .env 文件中。
然后你可以使用 Location::getGeoByIp({ip}) 来获取位置对象。之后你可以调用以下方法

  • getCountry();
  • getCity();
  • getСoordinates();

测试

使用以下命令运行测试

vendor/bin/phpunit