Right now I have a full address form in Nova and I'm using this package to autocomplete the address. I'd like to extract address_line_1 into it's own field. I have GoogleAutocomplete::make('Address Line 1')->withValues([...]) but it's setting 'Address Line 1' to be the full address (123 Main Street, City, State Zip, Country).
Whats the best way to go about having the auto-complete field only populate with the address_line_1 and not the full postal address?
Currently:
protected function addressFields()
{
return [
GoogleAutocomplete::make('Address Line 1')->withValues([
'locality',
'administrative_area_level_1',
'postal_code',
'country',
'latitude',
'longitude'
])->countries(['CA']),
Text::make('Address Line 2')->hideFromIndex(),
AddressMetadata::make('City')->fromValue('locality')->hideFromIndex(),
AddressMetadata::make('Province')->fromValue('administrative_area_level_1')->hideFromIndex(),
AddressMetadata::make('Postal Code')->fromValue('postal_code')->hideFromIndex(),
AddressMetadata::make('Country')->fromValue('country')->hideFromIndex(),
AddressMetadata::make('Latitude')->fromValue('latitude')->disabled()->hideFromIndex(),
AddressMetadata::make('Longitude')->fromValue('longitude')->disabled()->hideFromIndex(),
];
}
All fields populate properly except Address Line 1 which is the full postal address, not just the street address as expected.
Right now I have a full address form in Nova and I'm using this package to autocomplete the address. I'd like to extract address_line_1 into it's own field. I have
GoogleAutocomplete::make('Address Line 1')->withValues([...])
but it's setting 'Address Line 1' to be the full address (123 Main Street, City, State Zip, Country).Whats the best way to go about having the auto-complete field only populate with the address_line_1 and not the full postal address?
Currently:
All fields populate properly except Address Line 1 which is the full postal address, not just the street address as expected.