Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mkshingrakhiya's avatar

This won't have worked event it did not display because you see it displays private when event broadcasted to private channel which is handled by the server-side of the code. i.e. When we do return new PrivateChannel(...)

theUnforgiven's avatar

Which is

isTyping() {
            let channel = Echo.private('groups.' + this.group.id);

            setTimeout(function() {
                channel.whisper('typing', {
                user: this.currentUser.name, // THIS LINE
                    typing: true
                });
            }, 300);
        },
mkshingrakhiya's avatar

Use arrow functions if you're using this inside instead of anonymous function.

1 like
theUnforgiven's avatar

The typing indicator can be sorted afterwards, just need to get the name displaying when the message as been sent, so I commneted out the isTyping for now to remove that error I sent.

theUnforgiven's avatar

The message does show on the other users account, however the name does not

mkshingrakhiya's avatar

You need to debug it step by step because if you're message showing up, then it works. You might have some other issue somewhere in your code.

1 like
theUnforgiven's avatar
theUnforgiven
OP
Best Answer
Level 51

Yeah and just put isTyping back and changed to arrow function and that all works now, so just need to figure out the name issue.

Thank you greatly both @bryank & @mkshingrakhiya

mkshingrakhiya's avatar

Please choose the best solution that worked out for you for this thread. Post here if you encounter other other subject related issues.

mkshingrakhiya's avatar

Just comment the solution by yourself and mark it as the best answer. It will help others.

2 likes
Previous

Please or to participate in this conversation.