Skip to content

[Bug]: Validation fails for options #47

@stian-scholtz-snappi

Description

@stian-scholtz-snappi

What happened?

When attempting to save, filament throws a validation error.

How to reproduce the bug

When I have a schema containing:

GoogleAutocomplete::make('google_search') ->label('Search Google') ->autocompletePlaceholder('Search for an address on Google Maps') ->countries([ 'ZA', ]) ->columns() ->withFields([ TextInput::make('street_address') ->extraInputAttributes([ 'data-google-field' => '{street_number} {route}', ]), TextInput::make('suburb') ->extraInputAttributes([ 'data-google-field' => 'sublocality_level_1', ]), TextInput::make('city') ->extraInputAttributes([ 'data-google-field' => 'locality', ]), TextInput::make('postal_code') ->extraInputAttributes([ 'data-google-field' => 'postal_code', ]), Select::make('province') ->options(Province::pluck('name', 'id')) ->extraInputAttributes([ 'data-google-field' => 'administrative_area_level_1', ]), TextInput::make('latitude') ->extraInputAttributes([ 'data-google-field' => 'latitude', ]) ->hidden(), TextInput::make('longitude') ->extraInputAttributes([ 'data-google-field' => 'longitude', ]) ->hidden(), ]),

I get:

Filament failed to validate the [data.deliveryAddress.google_search.google_autocomplete_google_search] field's selected options because it did not have an [options()] or [getOptionLabelUsing()] configuration. Please use one of these methods to inform Filament which options are valid for this field.

Package Version

4.0.0

PHP Version

8.4

Laravel Version

12.0

Which operating systems does with happen with?

No response

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions