Add Broadcasting Example #3
Replies: 1 comment
-
That is also what i had in mind, logged in users can post messages on the dashboard just as you had suggested,and everyone else can see them. One way is creating an API that fetches all dashboard messages from our database and store them in Vuex's state ,from there we can easily display it to the client. The problem with this approach will have to hit our servers every time we need to get a newly posted message by someone who has just recently registered,so that it can be displayed to the client. It might also require the user to do a page refresh in order to see the new messages that have just been posted in the dashboard, giving a poor user experience. So to build on the idea the best way is to use web sockets where will only need a single API endpoint for verification that the current user can actually see this messages.This endpoint called |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be good to show how you can brodcast events in Laravel and automatically update the SPA using Pusher or something similar.
Beta Was this translation helpful? Give feedback.
All reactions