Nested HasMany Repeater β deleteAction always receives parent record instead of child
Hey everyone π
I have a nested Repeater setup β basically a HasMany inside another HasMany.
When I call ->deleteAction($record) on the inner repeater and dd($record) inside the actionβs body, I always get the parent record, not the specific child item that was deleted.
This makes it impossible to check certain conditions before deleting a specific child.
Has anyone run into this before or found a way to access the actual child record inside the delete action of a nested repeater?
Thanks in advance π
8 Replies
Can you provide the full code? Might need to use $state.
It is basicaly this code:
So the delete action will do that as fn($record), is the parent record as you passed it in, what I think you'll want is:
I think
That makes sense. I will try that later. π€
Wow, thanks. How did I miss that in the docs? I actually read this chapter... π€¦ββοΈ
no problem π
Get spot Leandro!