F
Filament4w ago
lmtc

KeyValue not saving new order

Hopefully someone has an idea where I'm going wrong - I have this inside a repeater:
KeyValue::make('options.select_options')
->label('Select Options')
->columnSpan('full')
->reorderable()
->keyLabel('Stored Value')
->valueLabel('Display Value')
->addActionLabel('Add option')
->visible(fn($get) => $get('type') === 'select_field'),
KeyValue::make('options.select_options')
->label('Select Options')
->columnSpan('full')
->reorderable()
->keyLabel('Stored Value')
->valueLabel('Display Value')
->addActionLabel('Add option')
->visible(fn($get) => $get('type') === 'select_field'),
but when I save it reverts to the old order?
5 Replies
toeknee
toeknee4w ago
Do the options relation have the order column? does the DB ever get updated? I would tend to use telescope and monitor the request
lmtc
lmtcOP4w ago
It's not a relation, it's the same table just another field. I'll have a look at the request!
toeknee
toeknee4w ago
I'm a little confused how options.select_options work usually this would mean options is a relationship...
lmtc
lmtcOP4w ago
Yea I probably should have done that - this is in a modal and I have a field called options I'm submitting to - this is my full code for this repeater:
toeknee
toeknee3w ago
I am guessing it's to do with your action method, try DDing and seeing if you get it correctly

Did you find this page helpful?