Refresh a resource after relation manager triggers model event
Hello! I have a relation manager on a resource, and I'm hoping I can refresh the resource after one of the relations is deleted, because on the resource is updated in the model observer. I can force a redirect back to the same page and that works fine, but it isn't as nice as I'd like it to be. Anyone know if that's possible?
5 Replies
you should use a livewire event. emit from the relation manager and listen for it on the page
and then refresh the data with
->refreshFormData()
great, adding the emit after the detach action and then adding a listener on the edit page worked! Thanks.
Is this the same approach, in general, to basically make the relation manager "live" or reactive...?
I have a similar situation where I want certain form elements to enable/disable (and other things) when changes are made for one of its relations.
Working with v3, btw....
Yes, events are the way to go