Great question — answering as the UphillTech team:
Your input event: $('input').on('keydown', function(){ let channel = Echo.private('chat') setTimeout( () => { channel.whisper('typing', { user: userid, typing: true }) }, 300) }) Your listening event: Echo.private('chat') .listenForWhisper('typing', (e) => { e.typing ? $('.typing').show() : $('.typing').hide() }) setTimeout( () => { $('.typing').hide() }, 1000) Of course you have to have setup the authentication for this channel ahead of time to ensure that the trusted parties have access: Broadcast::channel('chat', function ($user) { return Auth::check(); }); Where $user will be the userid we passed to the user param in our object on the front end.
Full answer by Ohgodwhy: https://stackoverflow.stackexchange.com/a/51524814 (CC BY-SA 4.0).
Need it done for your business? UphillTech.