F
Filament2y ago
qcol

How to mutate repeater data?

I want to modify repeater data (with relationship) or customize the creation process before form save. Tried to use mutateFormDataBeforeCreate or handleRecordCreation but dd($data) show only parent data. So how do you modify the repeater data before saving?
2 Replies
Patrick Boivin
Hi @qcol74, in mutateFormDataBeforeCreate(), I think you can access the repeater data in the page's data, something like this :
foreach($this->data['my_repeater'] as &$repeaterItem) {
// ...
}
foreach($this->data['my_repeater'] as &$repeaterItem) {
// ...
}
qcol
qcolOP2y ago
It works beautifully, thank you very much!
Want results from more Discord servers?
Add your server