F
Filament2y ago
sqrt

Access repeater's data

Hi, I cannot figure out how to access the data provided by repeater. I would appreciate any hint. Thanks!
8 Replies
Dan Harrin
Dan Harrin2y ago
access when and from where and why
sqrt
sqrtOP2y ago
Suppose I want to create new records based on a form contents. For that common dehydration using getState() works for all the fields from the form except for these inside repeater. I suppse there should be some array of data, but cannot find it in docs.
Dan Harrin
Dan Harrin2y ago
is it a relationship repeater
sqrt
sqrtOP2y ago
Yes, indeed
Dan Harrin
Dan Harrin2y ago
we save that for you then, hence why it isnt dehydrated if you are sure, you can pass ->dehydrated() to it and it should be in the state
sqrt
sqrtOP2y ago
Awsome, Dan! Thank you very much 🙂 One more thing. Since I do not want to create a record, just update the relation between existing entities by theirs' IDs, is it possible to overwrite the built-in query? I guess that will be saveRelationshipUsing...
Dan Harrin
Dan Harrin2y ago
you can set saveRelationshipsUsing(null) and then handle it yourself in the submit handler if you want
sqrt
sqrtOP2y ago
Thanks!

Did you find this page helpful?