Save to DB after deleting a repeater element
I am implementing a ChatGPT-like UI. I use a Repeater to populate the list of conversations. When I press the delete icon it deletes properly the element from the array but I would have to press Submit to save the modified list into the DB. What I want is to save the array immediately after pressing the Delete button (actually this control ideally doesn't even have a submit button).
I played a bit with deleteAction object (https://filamentphp.com/docs/3.x/forms/fields/repeater#customizing-the-repeater-action-objects) but it seems it can just setup the action in specific ways instead of running code after pressing the delete button.
This is my form:
4 Replies
Have you tried
->after()
on the repeater's delete action?Hi! No I didn't try that actually. At the end I changed my approach to just having a custom page inside the filament panel so I had more control. Another things I was missing is that I should be able to select one of the Repeater elements and then update the conversation on the right. I was taking way too much time to figure these things out that's why I changed to a custom page.
Thx for your help!
Hi! Could you explain please where and how to use it to save immediately to DB after deleting a repeater element?