baikho/loqate-php
最新稳定版本:v2.0.0
Composer 安装命令:
composer require baikho/loqate-php
包简介
A PHP Wrapper for the Loqate API
README 文档
README
A PHP Wrapper for the Loqate API.
Installation
composer require baikho/loqate-php
Usage
$loqate = new \Baikho\Loqate\Loqate('API Key');
Address Verification API
Find Address:
// Simple example. $result = $loqate->address()->find('foo'); // Advanced example. $result = (new \Baikho\Loqate\Address\Find('API Key')) ->setText('foo') ->setIsMiddleWare(TRUE) ->setContainer('bar') ->setCountries('NL') ->makeRequest();
Retrieve Address:
// Simple example. $result = $loqate->address()->retrieve('XX|XX|XXX|XXXXXXXXXX'); // Advanced example. $result = (new \Baikho\Loqate\Address\Retrieve('API Key')) ->setId('XX|XX|XXX|XXXXXXXXXX') ->makeRequest();
Geocoding API
The only APIs currently supported are
Calculate distance between two points.
Easting/Northing, Latitude/Longitude & Postcodes are supported.
$result = $loqate->geocoding()->distance('381600,259400', '380600,25840'); $result = $loqate->geocoding()->distance('51.4733514399,-0.00088499646', '51.492914695,-0.1215161806'); $result = $loqate->geocoding()->distance('SE10 8XJ', 'SW1A 0AA');
Get directions between two points.
Easting/Northing, Latitude/Longitude & Postcodes are supported.
$result = $loqate->geocoding()->directions('381600,259400', '380600,25840'); $result = $loqate->geocoding()->directions('51.4733514399,-0.00088499646', '51.492914695,-0.1215161806'); $result = $loqate->geocoding()->directions('SE10 8XJ', 'SW1A 0AA');
Geocode an International Place or Location
Country must be supplied as an ISO2 or ISO3 country code. Location can be a postal code or place name, Loqate ID also works.
$result = $loqate->geocoding()->geocode('GB', 'London');
Find a UK Place or Location
This can be a full or partial postcode, a place name or street comma town.
$result = $loqate->geocoding()->ukFind('London');
Geocode a UK Place or Location
This can be a full or partial postcode, a place name or street comma town.
$result = $loqate->geocoding()->ukGeocode('London');
Retrieve a UK Place or Location
This can be a full or partial postcode, a place name or street comma town.
$result = $loqate->geocoding()->ukRetrieve('XX|XX|XXX|XXXXXXXXXX');
Reverse Geocode a position to Address or Location
Returns the nearest address or location to the given coordinates. A postcode or coordinates (latitude, longitude or easting, nothing) of the centre of the search.
$result = $loqate->geocoding()->ukReverseGeocode('51.4733514399,-0.00088499646');
Email Verification API
Validate Email Address:
$result = $loqate->email()->validate('foo@example.com');
Bank Account Verification API
Validate Bank Account:
$result = $loqate->bankAccount()->validate('XXXXXXXX', 'XX-XX-XX');
Phone Verification API
Validate Phone Number:
$result = $loqate->phone()->validate('1234567890'); $result = $loqate->phone()->validate('1234567890', 'NL');
统计信息
- 总下载量: 75.2k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-25