A laravel package for fetching Address details
For more information see api-postcode
Laravel 5.1 or later
Installation is a quick 3 step process:
- Download api-postcode-laravelusing composer
- Enable the package in app.php
- Configure your Api Postcode credentials
Add api-postcode/api-postcode-laravel by running the command:
composer require api-postcode/api-postcode-laravel
Register the Service in: config/app.php
ApiPostcode\ApiPostcodeServiceProvider::class,php artisan vendor:publish
Add this in you .env file
API_POSTCODE_TOKEN=secret-token-from-api-postcode
$address = app('api.postcode')->fetchAddress('1012JS', 1);
$address->getStreet(); // Dam
$address->getCity(); // Amsterdam
$address->getHouseNumber(); // 1
$address->getZipCode(); // 1012JS
$address->getLongitude(); // 4.4584
$address->getLatitude(); // 52.2296