Intergrates the PostcodeNL API with Laravel 5 & 6 via a ServiceProvider and Facade. This package currently supports only the validation of dutch addresses.
composer require deniztezcan/laravel-postcodenl-api
Add a ServiceProvider to your providers array in
'providers' => [ //other things here DenizTezcan\LaravelPostcodeNLAPI\PostcodeNLAPIServiceProvider::class, ];
Add the facade to the facades array:
'aliases' => [ //other things here 'PostcodeNLAPI' => DenizTezcan\LaravelPostcodeNLAPI\Facades\PostcodeNLAPI::class, ];
Finally, publish the configuration files:
php artisan vendor:publish --provider="DenizTezcan\LaravelPostcodeNLAPI\PostcodeNLAPIServiceProvider"
Please set your API:
secret in the
To get the
city linked to a Dutch
extension. The response is returned in json format, ideal for ajax.
use PostcodeNLAPI; $data = PostcodeNLAPI::validateDutch('1010AA', '1', 'a');