This Laravel package comes with a toolbox to search for Dutch addresses using zip code and house number. In addition, it extends the validation rules with Dutch telephone number and zip code validation.
- Dutch Phone Number Validation
- Dutch Postal Code Validation
- Find address via Postal Code and House Number
Via Composer
$ composer require itsonlyjeff/dutch-helpers:^0.1
RandomController.php
use ItsOnlyJeff\DutchHelpers\Classes\NLPostCodeService;
// ...
$validator = $request->validate([
'phone' => ['required', 'dutch-phone-number'],
'zipcode' => ['required', 'dutch-zipcode'],
'house_number' => ['required', 'numeric'],
]);
$location_details = new NLPostCodeService($validator['zipcode'], $validator['house_number']);
$address = $location_details->adres;
$latlon = $location_details->locatie;
// etc...
Response
{
bron: "BAG",
postcode: "2595BG",
huisnummer: "1",
woonplaatsnaam: "'s-Gravenhage",
gemeentenaam: "'s-Gravenhage",
provincienaam: "Zuid-Holland"
provincieafkorting: "ZH"
straatnaam: "Prinses Irenepad"
adres: "Prinses Irenepad"
locatie: array:2 [▼
0 => "4.32599601"
1 => "52.08314722"
]
percelen: []
buurtnaam: "Bezuidenhout-West"
wijknaam: "Wijk 26 Bezuidenhout"
waterschapsnaam: "Hoogheemraadschap van Delfland"
gekoppeld_appartement: []
}
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
The MIT License (MIT). Please see License File for more information.