© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•8mo ago•
1 reply
tiago.pereira

Select multiple - fill

Is there a way to fill the field and its shows the updated select options?

Im using a filament form on a livewire component, and that form e a wizard, on the first step and user input a value and consult a api to prefill the data on the next steps, i can already fill all the data

with this

$this->form->fill([
'company' => [
'slug' => $company['seo_url'],
'name' => $company['title'],
'email' => $company['contacts']['email'],
'telefone' => $company['contacts']['phone'],
'address' => $company['address'],
'zip_code' => $company['pc4'].'-'.$company['pc3'],
'city' => $company['city'],
'caecodes' => collect($company['cae'] ?? [])
->filter()
->map(fn ($code) => (int) $code)
->values()
->all(),
],

and this is the select
Select::make('company.caecodes')->columnSpan(12)->multiple()
->relationship(name: 'caeCodes', titleAttribute: 'title')
->afterStateHydrated(
function (array $state) {
ray($state);
}
)


but the problem is that caecodes is a multi-select, i can see that the array is beeing filled, but the select does not update to show the values from the array as selected, if i select a new one its deletes the ones added from fill and keeps only the one from the from input

is there anyway to make the select show the values set by the form fill?

thanks
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Select::createOptionForm fill?
FilamentFFilament / ❓┊help
16mo ago
How to auto fill multiple select in Action
FilamentFFilament / ❓┊help
3y ago
Dependent Select -> Form Fill Issue
FilamentFFilament / ❓┊help
15mo ago
auto fill when i select
FilamentFFilament / ❓┊help
16mo ago