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