© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Wiebe

Select not filled after createOptionUsing

In V2 it worked fine but in V3 it doesnt. After submitting the form in the select, the option is visible in the select dropdown but the select goes to "select an option".

Select::make('location_id')
                                             ->label(__('manage.location'))
                                             ->options(fn() => $this->organisation->locations->pluck('label', 'id'))
                                             ->createOptionForm([
                                                 SingleLayout::make()->schema([
                                                     TextInput::make('name')->label(__('manage.name_location'))->required(),
                                                     TextInput::make('address')->label(__('manage.address')),
                                                     TextInput::make('zipcode')->label(__('manage.zipcode')),
                                                     TextInput::make('city')->label(__('manage.city'))->required(),
                                                 ])
                                             ])->reactive()->createOptionUsing(function($data, Forms\Set $set){
                                               $location = new Location();
                                               $location->organisation_id = $this->organisation->id;
                                               $location->fill($data);
                                               $location->save();
                                               $set('location_id', $location->id);
                                               return $location->id;
                                           }),
Select::make('location_id')
                                             ->label(__('manage.location'))
                                             ->options(fn() => $this->organisation->locations->pluck('label', 'id'))
                                             ->createOptionForm([
                                                 SingleLayout::make()->schema([
                                                     TextInput::make('name')->label(__('manage.name_location'))->required(),
                                                     TextInput::make('address')->label(__('manage.address')),
                                                     TextInput::make('zipcode')->label(__('manage.zipcode')),
                                                     TextInput::make('city')->label(__('manage.city'))->required(),
                                                 ])
                                             ])->reactive()->createOptionUsing(function($data, Forms\Set $set){
                                               $location = new Location();
                                               $location->organisation_id = $this->organisation->id;
                                               $location->fill($data);
                                               $location->save();
                                               $set('location_id', $location->id);
                                               return $location->id;
                                           }),
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

createOptionUsing on select not called in livewire component
FilamentFFilament / ❓┊help
2y ago
Select::createOptionUsing not updating selected element in v3
FilamentFFilament / ❓┊help
3y ago
Problem with createOptionUsing in Single Select
FilamentFFilament / ❓┊help
9mo ago
createOptionUsing() doesn't select new value
FilamentFFilament / ❓┊help
3y ago