Repeater Relationship not ready on afterCreate()

Hello, I have a Model Resource with a repeater relationship in it, however when I try to do some data processing from a event fired from afterCreate() it appears the relationship data is NOT ready, so I presume this is ran before relationships is saved. What is the best way around this? I've tried afterCreate() in the CreateModel.php file
3 Replies
LeandroFerreira
LeandroFerreira2mo ago
I think you can use $this->record->your_relationship in the afterCreate method
Zombiezach8
Zombiezach8OP2mo ago
I have tried that but it returns empty sadly.
LeandroFerreira
LeandroFerreira2mo ago
You can add ->dehydrated() to the repeater, but you need to save the data manually.

Did you find this page helpful?