nickurt/laravel-postcodeapi
Laravel PostcodeApi
Installation
Install this package with composer:
composer require nickurt/laravel-postcodeapi
Copy the config files for the api
php artisan vendor:publish --provider="nickurt\PostcodeApi\ServiceProvider" --tag="config"
Examples
Default - de_DE
$postCode10 = PostcodeApi::create('ZippopotamusDE')->find('07751');
Default - en_AU
$postCode11 = PostcodeApi::create('PostcodeApiComAu')->find('3066');
Default - en_GB
$postCode12 = PostcodeApi::create('GetAddressIO')->find('SW1A1AA');
$postCode13 = PostcodeApi::create('IdealPostcodes')->find('SW1A1AA');
$postCode14 = PostcodeApi::create('PostcodesIO')->find('SW1A1AA');
Default - en_US
$postCode15 = PostcodeApi::create('Bing')->find('92270');
$postCode16 = PostcodeApi::create('Geocodio')->find('92270');
$postCode17 = PostcodeApi::create('Google')->find('92270');
$postCode18 = PostcodeApi::create('Here')->find('92270');
$postCode19 = PostcodeApi::create('LocationIQ')->find('92270');
$postCode20 = PostcodeApi::create('Mapbox')->find('92270');
$postCode21 = PostcodeApi::create('OpenCage')->find('92270');
$postCode22 = PostcodeApi::create('TomTom')->find('92270');
Default - fr_FR
$postCode23 = PostcodeApi::create('AdresseDataGouv')->find('75007');
$postCode24 = PostcodeApi::create('AdresseDataGouv')->findByPostcodeAndHouseNumber('75007', '5 Avenue Anatole France');
Default - nl_BE
$postCode25 = PostcodeApi::create('Pro6PP_BE')->find('1000');
Default - nl_NL
$postCode26 = PostcodeApi::create('ApiPostcode')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode27 = PostcodeApi::create('NationaalGeoRegister')->find('1118CP');
$postCode28 = PostcodeApi::create('NationaalGeoRegister')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode29 = PostcodeApi::create('PostcoDe')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode30 = PostcodeApi::create('PostcodeApiNu')->find('1118CP');
$postCode31 = PostcodeApi::create('PostcodeApiNu')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode32 = PostcodeApi::create('PostcodeApiNuV3')->find('1118CP');
$postCode33 = PostcodeApi::create('PostcodeApiNuV3')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode34 = PostcodeApi::create('PostcodeNL')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode35 = PostcodeApi::create('Pro6PP_NL')->find('1118CP');
Route
Route::get('/{postCode}', function($postCode) {
$postCode36 = PostcodeApi::create('PostcodeApiNu')->find($postCode);
return Response::json($postCode35->toArray(), 200, [], JSON_PRETTY_PRINT);
});
Providers
AdresseDataGouv, ApiPostcode, Bing, Geocodio, GetAddresIO, Google, Here, IdealPostcodes, LocationIQ, Mapbox, NationaalGeoRegister, OpenCage, postco.de, PostcodeApiComAu, PostcodeApiNu, PostcodeNL, PostcodesIO, Pro6PP_BE, Pro6PP_NL, TomTom
Tests
composer test
Related Packages
postcode-nl/api-client
A client to the Postcode.nl Address Api for international address validation. Yo...
511,552
5
cyvelnet/laravel5-fractal
A simple fractal service provider and transformer generator with model attribute...
190,126
79
pixelpeter/laravel5-woocommerce-api-client
Laravel 5 wrapper for the Woocommerce REST API
107,047
123
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 2.1 | ^8.2 | ^11.0| | MIT | |
| 2.0 | ^8.2 | ^11.0| | MIT | |
| 1.21 | ^8.2 | ^10.0| | MIT | |
| 1.20 | ^8.1 | ^9.0| | MIT | |
| 1.19 | ^8.1 | ^9.0| | MIT | |
| 1.18 | ^8.1 | ^9.0| | MIT | |
| 1.17 | ^8.0 | ^8.0| | MIT | |
| 1.16.1 | ^8.0| | ^6.0| | MIT | |
| 1.16 | ^8.0| | ^6.0| | MIT | |
| 1.15.0 | ^7.2 | ^6.0| | MIT | |
| 1.14 | ^7.2 | ^6.0| | MIT | |
| 1.13 | ^7.1.3 | ^6.0| | MIT | |
| 1.12 | ^7.1.3 | ^6.0| | MIT | |
| 1.11 | ^7.1.3 | ^6.0| | MIT | |
| 1.10 | ^7.1.3 | ^5.8| | MIT | |
| 1.9 | ^7.1.3 | ^5.8| | MIT | |
| 1.8 | ^7.1.3 | 5.8.* | MIT | |
| 1.7 | ^7.2 | 5.8.* | MIT | |
| 1.6 | ^7.1.3 | 5.7.* | MIT | |
| 1.5 | ^7.0 | ~5.5.0| | MIT | |
| 1.4 | ^7.0 | ~5.5.0| | MIT | |
| 1.3 | ^7.0 | ~5.5.0| | MIT | |
| 1.2 | ^7.0 | MIT | ||
| 1.1 | ^7.0 | MIT | ||
| 1.0 | >=5.6.0 | MIT | ||
| 0.1 | >=5.4.0 | MIT |