Then users, if there are two users connected, will print as [true, true].
Digging deeper, by moving window.Echo.join('App') into a const and printing the const into the here context then you'll have the following:
So what's the point? channel.subscription.members.members contains an object, key-valued, with the id of the user and a true.
I expect that users in here function contains that data. Basically, the code responsible to bind users param into the callback is doing something unexpected, by design or by failure, which removes those keys. Probably because converts the object channel.subscription.members.members into an array without that keys preservation.
By the way, i'm considering using the channel.subscription.members.members as a short-term solution but honestly, sounds weird to use the api of the channel instead of the parameter. I mean, that's why users param exists. LOL
Reverb Version
v1.0.0
Laravel Version
11.15.0
PHP Version
8.3
Description
When you're trying to implement the presence channel like the following:
Then
users
, if there are two users connected, will print as[true, true]
.Digging deeper, by moving
window.Echo.join('App')
into a const and printing the const into thehere
context then you'll have the following:So what's the point?
channel.subscription.members.members
contains an object, key-valued, with the id of the user and a true.I expect that
users
inhere
function contains that data. Basically, the code responsible to bindusers
param into the callback is doing something unexpected, by design or by failure, which removes those keys. Probably because converts the objectchannel.subscription.members.members
into an array without that keys preservation.So:
returns
By the way, i'm considering using the
channel.subscription.members.members
as a short-term solution but honestly, sounds weird to use the api of the channel instead of the parameter. I mean, that's whyusers
param exists. LOLSteps To Reproduce