samedi 7 janvier 2017

How to display an online members list

I am following a blog on Laravel Echo and I was wondering how would I display all users that are currently on the presence channel?

This code shows who made the most recent action in the console.

Echo.join('chat-room-presence.1')
.here(function (members) {
    // runs when you join
    console.table(members);
})
.joining(function (joiningMember, members) {
    // runs when another member joins
    console.table(joiningMember);
})
.leaving(function (leavingMember, members) {
    // runs when another member leaves
    console.table(leavingMember);
});

How would you modify the code to show all users on the presence channel in the console?

And how would you display them on a view?

I'm just a beginner at this, so forgive me for not understanding.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2iOUGhV
via IFTTT

Aucun commentaire:

Enregistrer un commentaire