Answer the question
In order to leave comments, you need to log in
How to send a notification to the client immediately after connection?
Event:
class PlaylistTitleUpdate implements ShouldBroadcast
{
/*.......*/
public function broadcastOn()
{
return new PresenceChannel('playlist.'.$this->playlist->slug);
}
/*.......*/
}
window.Echo.join(`playlist.novoe`)
.here((users) => {})
.joining((user) => {})
.leaving((user) => {})
.listen('PlaylistTitleUpdate', (e) => {
console.log(e);
});
listen 'PlaylistTitleUpdate'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question