Dear everyone,
I've been building an application lately and I am facing quite an interesting but challenging aspect in my opinion. I will try to explain it as clear as possible:
When visiting the index page of the application, a visitor (no authentication is required) can upload a file, and will then be redirected to the /files/{id} URL. This URL returns a blade view with the file model as data. It's a traditional show method on the controller.
A job will be queued that does an API call to an external service (within the payload, a callback URL (defined in my api routes file) is included. A call from the external service to my API will change the data of the file record that was created earlier.
What I want to achieve is that the data is updated real time at the visitor's screen. I know this can be achieved using broadcasting.
But how should refresh the data at the client? Should I use Vue.js component inside of my show.blade.php view, that upon receiving the broadcasting signal does an API call to a files/{file} endpoint through Axios to refresh the data displayed? Wouldn't this make the files/{file} web route and blade view redundant?
Or should I make a simple script on the show.blade.php view that upon receiving the broadcast signal forces a real page refresh?
I'm a bit confused on how to approach this. What do you all recommend or how would you do this?