© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
6 replies
tidiani12

How to get record of select relationship automatically

Select::make('type_infrastructure_id')
                            ->relationship(name: 'typeInfrastructure', titleAttribute: 'nom')
                            ->createOptionForm([
                                Forms\Components\TextInput::make('nom')
                                    ->required(),
                                Toggle::make('surface')
                                    ->onColor('success')
                                    ->offColor('danger'),
                                Toggle::make('circular')
                                    ->onColor('success')
                                    ->offColor('danger'),
                                Toggle::make('volume')
                                    ->onColor('success')
                                    ->offColor('danger'),
                            ]),
                        TextInput::make('longueur')
                            ->hidden(fn(\Filament\Forms\Get $get) => $get('type_infrastructure_id') ? $type_infrastructure_id->name === '///here' : true),
Select::make('type_infrastructure_id')
                            ->relationship(name: 'typeInfrastructure', titleAttribute: 'nom')
                            ->createOptionForm([
                                Forms\Components\TextInput::make('nom')
                                    ->required(),
                                Toggle::make('surface')
                                    ->onColor('success')
                                    ->offColor('danger'),
                                Toggle::make('circular')
                                    ->onColor('success')
                                    ->offColor('danger'),
                                Toggle::make('volume')
                                    ->onColor('success')
                                    ->offColor('danger'),
                            ]),
                        TextInput::make('longueur')
                            ->hidden(fn(\Filament\Forms\Get $get) => $get('type_infrastructure_id') ? $type_infrastructure_id->name === '///here' : true),
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

Get relationship Select record data from $get
FilamentFFilament / ❓┊help
3y ago
How to automatically save a relationship of a select?
FilamentFFilament / ❓┊help
3y ago
Select relationship automatically select value after creation
FilamentFFilament / ❓┊help
8mo ago
TextColumn get relationship record
FilamentFFilament / ❓┊help
2y ago