Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 9 days 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 (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-01T11:50:43.000Z (almost 3 years ago)
- Last Synced: 2024-12-07T21:41:05.944Z (about 1 month 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
![workflow](https://github.com/md-aamroni/coordinate/actions/workflows/application.yml/badge.svg)
![Copyright](https://img.shields.io/badge/Copyright-aDecoder-brightgreen.svg)
[![License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](./LICENSE)
![Developed](https://img.shields.io/badge/PHP->=8.0-brightgreen.svg)
![Copyright](https://img.shields.io/badge/Developer-md.aamroni-brightgreen.svg)### 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 '
```