Broadcast an Event and remove item from Resource index
I have a list of "Abandoned Orders" listed as a Nova Resource. Orders are coming in via webhook using API endpoint in Laravel.
What I would like to do is to broadcast an event when one of those orders is opened because I have to hide it from the list for all other agents in the call centre (to prevent a duplicate calls to same customers).
I have created a custom Vue component (outside of Nova) with such functionality using Pusher + Echo and it is working fine, but I would like to do that in Nova (great search and filtering options - would take too much time to build this from scratch). Here is a preview of existing functionality: https://gofile.io/?c=adCzjn
My questions are:
- How do I even use custom JS code on the Nova Resource index page? I have overwritten Nova layout.blade.php file and added a mix() asset, but this feels wrong.
- How do I access Nova Resource data in Vue (I have already enabled Vue devtools, but I can't figure it out)?
Thank you in advance!
Please or to participate in this conversation.