1.0.2
1.0.2.0
MIT
The Requires
by aditya menon
1.0.1
1.0.1.0
MIT
The Requires
by aditya menon
1.0.0
1.0.0.0
The Requires
by aditya menon
Wallogit.com
2017 © Pedro Peláez
This is a fork of chadanuk/postcodes-io-laravel., (*1)
A laravel package for querying the postcodes.io web service., (*2)
Most of the Guzzle layer code was taken from @BoxUk's Symfony bundle, many props!, (*3)
License, (*4)
Installation is handled via Composer., (*5)
Run the following command:, (*6)
$ composer require muzzaopencopy/postcodes-io dev-master
This should add the following to your project's composer.json file:, (*7)
"require": {
"muzzaopencopy/postcodes-io-laravel": "dev-master"
}
Add the Service Provider to your app/config/app.php file:, (*8)
'providers' => array('MuzzaOpenCopy\PostcodesIo\PostcodesIoServiceProvider')
Add the Facade in the same file:, (*9)
'aliases' => array('PostcodesIo' => 'MuzzaOpenCopy\PostcodesIo\Facade')
Use the PostcodesIo facade with any of the methods below to get data from the service. For example: PostcodesIo::lookup('CF10 1DD')., (*10)
API documentation, (*11)
Lookup data about a particular postcode., (*12)
Parameters:
* postcode (Required): The postcode., (*13)
Example:, (*14)
$response = $client->lookup(array('postcode' => 'CF10 1DD'));
API documentation, (*15)
Lookup data about a set of postcodes., (*16)
Parameters:
* postcodes (Required): An array of postcodes (max 100)., (*17)
Example:, (*18)
$response = $client->bulkLookup(array('postcodes' => array('CF10 1DD', 'W1B 4BD'));
API documentation, (*19)
Get data for postcodes nearest a given latitude/longitude coordinate., (*20)
Parameters:
* latitude (Required): The latitude.
* longitude (Required): The longitude.
* limit (Optional): The maximum number of postcodes to return (default 10, max 100).
* radius (Optional): The radius in metres in which to find postcodes (default 100, max 1000)., (*21)
Example:, (*22)
$response = $client->reverseGeocode(array('latitude' => 51.481667, 'longitude' => -3.182155);
API documentation, (*23)
Bulk translation of latitude/longitude coordinates into postcode data., (*24)
Parameters:
* geolocations (Required): The geolocations to look up (maximum 100). This parameter should be an array, each element with the following keys:, (*25)
* `latitude` _(Required)_: The latitude. * `longitude` _(Required)_: The longitude. * `limit` _(Optional)_: The maximum number of postcodes to return (default 10, max 100). * `radius` _(Optional)_: The radius in metres in which to find postcodes (default 100, max 1000).
Example:, (*26)
$response = $client->bulkReverseGeocode(
array(
'geolocations' => array(
array('latitude' => 51.481667, 'longitude' => -3.182155),
array('latitude' => 51.88328, 'longitude' => -3.43684, 'limit' => 5, 'radius' => 500)
)
)
);
API documentation, (*27)
Find postcodes matching a given query., (*28)
Parameters:
* query (Optional): The postcode query, e.g. 'CF10'.
* limit (Optional): The maximum number of postcodes to return (default 10, max 100)., (*29)
Example:, (*30)
$response = $client->matching(array('query' => 'CF10', 'limit' => 20);
API documentation, (*31)
Validate a postcode., (*32)
Parameters:
* postcode (Required): The postcode to validate., (*33)
Example:, (*34)
$response = $client->validate(array('postcode' => 'CF10 1DD');
API documentation, (*35)
Get a list of postcodes to autocomplete a partial postcode., (*36)
Parameters:
* postcode (Required): The postcode to autocomplete.
* limit (Optional): The maximum number of postcodes to return (default 10, max 100)., (*37)
Example:, (*38)
$response = $client->autocomplete(array('postcode' => 'CF10', 'limit' => 20);
API documentation, (*39)
Get data for a random postcode., (*40)
Parameters: None., (*41)
Example:, (*42)
$response = $client->random();
API documentation, (*43)
Get data for the specified "outward code" (first half of postcode)., (*44)
Parameters:
* outcode (Required): The outward code (first half of postcode) to get location data for., (*45)
Example:, (*46)
$response = $client->outwardCodeLookup(array('outcode' => 'CF10');
MIT
MIT