api-postcode / api-postcode-bundle
Symfony Api Postcode bundle
Installs: 3 262
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 3
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=7.1.0
- ext-json: *
- api-postcode/php-client: ^1.0
- symfony/framework-bundle: ^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is not auto-updated.
Last update: 2024-12-12 09:12:35 UTC
README
This bundle can be useed to fetch Address details from zipcode with number.
See: https://api-postcode.nl for more information.
Installation
Installation is a quick 3 step process:
- Download api-postcode-bundle using composer
- Enable the Bundle in AppKernel.php
- Configure Api Postcode credentials
Step 1: Download postcode-bundle using composer
Add ApiPostcodeBundle by running the command:
$ composer require api-postcode/api-postcode-bundle
Step 2: Enable the Bundle in AppKernel.php
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new ApiPostcode\PostcodeBundle\ApiPostcodeBundle(), ); }
Step 3: Configure Api Postcode credentials
# app/config/config.yml # Api Postcode Token api_postcode: token: secret-token
Usage Services
$address = $this->get('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
Usage from API
Or try the API response: