© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
Luuk Dahlmans

createOptionForm does not return the correct query

Hi,

I am tying to create a createOptionForm. But for some reason it is ignoring all of the fields I defined.
It just gives a basic create query:

INSERT INTO `relation_addresses` (`updated_at`, `created_at`) VALUES (2023-10-09 14:46:58, 2023-10-09 14:46:58) 
INSERT INTO `relation_addresses` (`updated_at`, `created_at`) VALUES (2023-10-09 14:46:58, 2023-10-09 14:46:58) 


This is my select input: (I removed some fields due to the Discord character limit.)
->createOptionForm(function (Get $get) {
                        return [
                            Forms\Components\TextInput::make('relation_id')->default($get('relation_id')),
                            Forms\Components\TextInput::make('name')->label('Naam')
                                ->required()
                                ->maxLength(255),
                        ];

                        }
->createOptionForm(function (Get $get) {
                        return [
                            Forms\Components\TextInput::make('relation_id')->default($get('relation_id')),
                            Forms\Components\TextInput::make('name')->label('Naam')
                                ->required()
                                ->maxLength(255),
                        ];

                        }


This is the parent select:
 Forms\Components\Select::make('relation_address_id')->label('Kies een adres')
                    ->relationship('relationAddress', 'name')
                    ->disabled(fn (Forms\Get $get) => $get('relation_id') == null)
                    ->required()
                    ->options(function(callable $get) {
                        $relation = Relation::find($get('relation_id'));
                        if (!$relation) {
                            return [];
                        }
                        return $relation->addresses()->pluck('name', 'id');
                    })
                    ->createOptionForm(__The code above__)
);
 Forms\Components\Select::make('relation_address_id')->label('Kies een adres')
                    ->relationship('relationAddress', 'name')
                    ->disabled(fn (Forms\Get $get) => $get('relation_id') == null)
                    ->required()
                    ->options(function(callable $get) {
                        $relation = Relation::find($get('relation_id'));
                        if (!$relation) {
                            return [];
                        }
                        return $relation->addresses()->pluck('name', 'id');
                    })
                    ->createOptionForm(__The code above__)
);


Does anyone know what I am doing wrong?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Table does not edit the correct item
FilamentFFilament / ❓┊help
2y ago
Select does not return the Bank values
FilamentFFilament / ❓┊help
3y ago
Login does not redirect to the correct page
FilamentFFilament / ❓┊help
3y ago
createOptionForm not checking policys
FilamentFFilament / ❓┊help
2y ago