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,
]),
0 Replies
No replies yetBe the first to reply to this messageJoin