Google Address
The Google Address module provides GooglePlacesAddressDriver for AddressField.
Use it when an application needs Google Places autocomplete or a stricter address lookup flow than the default address driver.
Install
composer require qore-next/google-address
The package auto-discovers GoogleAddressServiceProvider.
No migrations, config or routes are published by this module. Install it, enable it in the modules UI and configure the API key when Google lookup is needed.
Usage
Use AddressField normally:
AddressField::make('address');
Or set the driver manually:
AddressField::make('address')
->setDriver(new GooglePlacesAddressDriver(includedRegionCodes: ['nl', 'de']));
If no API key is configured, the driver can still use Dutch postcode lookup for matching searches.
Configure
Enable the module in Qore's modules UI, then save the Google API key in the module settings.
The key is stored as:
qore()->settings()->getSetting('google-address.api_key');
The settings form validates the key against Google Places autocomplete.
Boot Behaviour
When the setting exists, the module sets GooglePlacesAddressDriver as the default AddressService driver.