© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•4mo ago•
3 replies
keiron

->relationship() on form field directly?

I have a relationship field:

                                  Select::make('gender')
                                    ->options([
                                        'male' => 'Male',
                                        'female' => 'Female',
                                    ]),
                                  Select::make('gender')
                                    ->options([
                                        'male' => 'Male',
                                        'female' => 'Female',
                                    ]),


I tried adding ->relationship('profile') to it but the value of the field was not prefilled. I then read the docs and saw that this works:

                           Group::make()
                            ->relationship('profile')
                            ->schema([
                                Select::make('gender')
                                    ->options([
                                        'male' => 'Male',
                                        'female' => 'Female',
                                    ]),
                            ]),
                           Group::make()
                            ->relationship('profile')
                            ->schema([
                                Select::make('gender')
                                    ->options([
                                        'male' => 'Male',
                                        'female' => 'Female',
                                    ]),
                            ]),


I am just wondering if I would be able to define the relationship on the field directly somehow, rather than having to add Group::make()?
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

Missing field on relationship
FilamentFFilament / ❓┊help
2y ago
Form field in relationship to pivot table
FilamentFFilament / ❓┊help
3y ago
odd form behavior on relationship
FilamentFFilament / ❓┊help
2y ago