© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
RamboRoland

Preload Resource data for form

Is it possible to preload data for a resource? I have 2 Repeaters nested and that makes 14 queries with 1 item. Can i preload?

Filament: 3.0.86

$form
    ->schema([
        Forms\Components\TextInput::make('name')
            ->columnSpan(3),
        Forms\Components\Repeater::make('days')
            ->relationship()
            ->label('Days')
            ->orderColumn('day')
            ->schema([
                Forms\Components\Repeater::make('nutrients')
                    ->label('Nutrients')
                    ->relationship()
                    ->schema([
                        Forms\Components\TextInput::make('parts'),
                        Forms\Components\Select::make('nutrient_id')
                            ->options($nutrients->pluck('name', 'id'))
                    ]),
                Forms\Components\Repeater::make('oncePerDayNutrients')
                    ->relationship()
                    ->schema([
                        Forms\Components\TextInput::make('ml'),
                        Forms\Components\Select::make('nutrient_id')
                            ->label('Nutrient')
                            ->options($nutrients->pluck('name', 'id'))
                    ]),
                Forms\Components\Repeater::make('lights')
                    ->relationship()
                    ->schema([
                        Forms\Components\Select::make('light_id')
                            ->label('Light')
                            ->options($lights->pluck('name', 'id'))
                    ])
            ])
    ]);
$form
    ->schema([
        Forms\Components\TextInput::make('name')
            ->columnSpan(3),
        Forms\Components\Repeater::make('days')
            ->relationship()
            ->label('Days')
            ->orderColumn('day')
            ->schema([
                Forms\Components\Repeater::make('nutrients')
                    ->label('Nutrients')
                    ->relationship()
                    ->schema([
                        Forms\Components\TextInput::make('parts'),
                        Forms\Components\Select::make('nutrient_id')
                            ->options($nutrients->pluck('name', 'id'))
                    ]),
                Forms\Components\Repeater::make('oncePerDayNutrients')
                    ->relationship()
                    ->schema([
                        Forms\Components\TextInput::make('ml'),
                        Forms\Components\Select::make('nutrient_id')
                            ->label('Nutrient')
                            ->options($nutrients->pluck('name', 'id'))
                    ]),
                Forms\Components\Repeater::make('lights')
                    ->relationship()
                    ->schema([
                        Forms\Components\Select::make('light_id')
                            ->label('Light')
                            ->options($lights->pluck('name', 'id'))
                    ])
            ])
    ]);
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

Testing form data for a simple resource (Filament v3).
FilamentFFilament / ❓┊help
2y ago
Resource form
FilamentFFilament / ❓┊help
3y ago
dynamic colspan for resource form
FilamentFFilament / ❓┊help
2y ago
Refresh page data from resource form action
FilamentFFilament / ❓┊help
15mo ago