© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
skyrowl

Slow select relationship in a relationship repeater

Hey, I have something like:
Event (top record) > Schedules (relationship repeater) > (Pivot) > Product (relationship select)
Loading the event record is fast, same as schedules (~ 2-5ms per record) but debugbar tells me that the last relationship takes around 300-500ms per Schedule and per Product Select
So if I'm having 5 Schedules it will take 5 * 300 = 1,5sc to load the form at best
I don't really know how to optimize that neither what I'm doing wrong, maybe could be the json column as the name attribute ? Could you help me please ?

Here's the code of the select
Forms\Components\Select::make('products')
  ->label('Activité(s)')
  ->relationship('productsWithoutTrashed')
  ->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->attribute_data['title']->getValue()}")
  ->multiple()
  ->required()
  ->placeholder('Sélectionner une activité')
  ->preload()
  ->searchable(['attribute_data->title'])
  ->columnSpan([
    'default' => 6,
    'lg' => 3,
  ]),
Forms\Components\Select::make('products')
  ->label('Activité(s)')
  ->relationship('productsWithoutTrashed')
  ->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->attribute_data['title']->getValue()}")
  ->multiple()
  ->required()
  ->placeholder('Sélectionner une activité')
  ->preload()
  ->searchable(['attribute_data->title'])
  ->columnSpan([
    'default' => 6,
    'lg' => 3,
  ]),
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

Repeater relationship select
FilamentFFilament / ❓┊help
13mo ago
Select in repeater
FilamentFFilament / ❓┊help
2y ago
BelongsToMany relationship in Repeater
FilamentFFilament / ❓┊help
3y ago
Select with relationship inside repeater return null.
FilamentFFilament / ❓┊help
13mo ago