alfa-dev-team / abstractapi-geo
A description for abstractapi-geo.
Package info
github.com/alfa-dev-team/abstractapi-geo
Type:package
pkg:composer/alfa-dev-team/abstractapi-geo
1.0
2022-04-19 15:47 UTC
Requires
- php: ^8.0
Requires (Dev)
- orchestra/testbench: ^6.0
This package is auto-updated.
Last update: 2026-02-20 00:54:47 UTC
README
Install
composer require alfa-dev-team/abstractapi-geo
php artisan vendor:publish --provider="AlfaDevTeam\AbstractapiGeo\AbstractapiGeoServiceProvider" --tag="migrations"
Usage
Add parameter ABSTRACTAPI_IP_GEOLOCATION_API_KEY= to the .env file.
You can then use Location::getGeoByIp({ip}) to retrieve the location object.
After you can call follow method:
getCountry();getCity();getДoordinates();
Testing
Run the tests with:
vendor/bin/phpunit