I would start by advicing you using Socket rather than Pusher, and then have a look at https://laracasts.com/discuss/channels/general-discussion/step-by-step-guide-to-installing-socketio-and-broadcasting-events-with-laravel-51/
Event listen when a user updates db query
hey great folks!
I have implemented pusher to try it out and I'm kind of new to laravel so please bare with me.
My controller:
$lists = Auth::user()->lists;
$users = Auth::user();
return view('pages.lists’, compact(’lists’, 'users'));
And in my view I have:
@foreach ($lists as $list)
<li><a href="{{ $list->address }}"><p>{{ $list->body }}</p></a></li>
@endforeach
The examples I've seen for pusher are using event listeners when someone hits a url and this is what I have using Laravel, Pusher and Vue by following Jeffs video: https://laracasts.com/series/whats-new-in-laravel-5-1/episodes/12
What I would like to accomplish is listen to an event when a authorized user adds a new list in the db. The list itself gets saved in a mysql database right now using address and body columns. So when a user ads a new list item in the backend, he or she will will see the new list item in their frontend and a message.
How can I achieve this and in particular so that only the user gets a update on their own items and not someone elses? Also, would I need to refactor the blade code to work with vue?
Please or to participate in this conversation.