https://github.com/md-aamroni/coordinate
Distance Calculate and 3rd Party API Services in PHP
https://github.com/md-aamroni/coordinate
coordinates distance-calculation geolocation ipaddress-tracker ipapi positionstack-api
Last synced: 3 months ago
JSON representation
Distance Calculate and 3rd Party API Services in PHP
- Host: GitHub
- URL: https://github.com/md-aamroni/coordinate
- Owner: md-aamroni
- License: mit
- Created: 2022-02-01T11:44:26.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-01T11:50:43.000Z (about 4 years ago)
- Last Synced: 2024-12-28T20:12:27.043Z (about 1 year ago)
- Topics: coordinates, distance-calculation, geolocation, ipaddress-tracker, ipapi, positionstack-api
- Language: PHP
- Homepage: https://md-aamroni.github.io
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Distance Calculate and 3rd Party API Services in PHP


[](./LICENSE)


### Installation
```bash
composer require adecoder/coordinate
```
### [Environment Varaible](.env-example)
```env
IP_API_KEY=your-api-key
IP_API_URL=http://api.ipapi.com/
POSITION_STACK_KEY=your-api-key
POSITION_STACK_URL=http://api.positionstack.com/v1/reverse
```
### Distance Calculate
```php
use Adecoder\Coordinate\Distance;
$area = new Distance();
echo $area->set(lat1: 23.6293159, lng1: 90.4870177, lat2: 24.3761958, lng2: 88.5793325)->get(unit: 'k');
```
### IP Details
```php
use Adecoder\Coordinate\Lookup;
use Adecoder\Coordinate\Clients\Services\IpApi;
$loopup = new Lookup();
echo '
';
print_r($loopup->ipaddr(ip: '103.151.11.64'))
echo '
';
```
### GeoLocation Details
```php
use Adecoder\Coordinate\Lookup;
$coords = new Lookup();
echo '
';
print_r($loopup->coords(lat: '23.6307225', lng: '90.4901339'))
echo '
';
```