Support the ongoing development of →
Installation Configuration Security
Last updated 2 years ago.

i just simply cant get this to work


Hi there,

Thanks for this tutorial. Indeed not much to find about laravel-echo itself.

I just have a question. We are using the same setup as you do. A Laravel API backend and a different frontend with angular. I was wondering where you putted the file which has the import Echo from 'laravel-echo'; and how to get the token there.

I only have the token when i am logged in.

Thanks :)


You saved my day(s). I was close to quit the whole idea of private channels.

Thank you very much!


Mate!!! If this works you save me hours of madness. I am doing a Vuejs app and I was struggling with the same packages. I am getting error: unauthenticated. I did not know that a header token could be passed with Laravel-echo. I will try this later and comment. Thanks!


Holy sh#@|# it works hehehe. Thank you very much!!!

@matthbon if you are still wondering where to import Echo. I'am importing it when user Logs in to get token or in a verification that I make if token it's stored locally so there is no need to login.


Great! @Tesseract what is the right way for implement a socket for authenticate user and guest. Thanks!!!


It works for me either when using Echo.private but when using Echo.join(...) ( + here,joining,leaving) it throws some errors in server log:

[12:31:32 AM] - mYBcuPMgMp4v6RqvAAAY left channel: presence-chat.ZPgLCxY6 (transport close)

(node:13265) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 11): Type
Error: Cannot convert undefined or null to object

(node:13265) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 12): Type
Error: Cannot convert undefined or null to object

[12:32:01 AM] - ILArCPOdNHlgywZaAAAZ authenticated for: private-chat.ZPgLCxY6

[12:32:01 AM] - ILArCPOdNHlgywZaAAAZ joined channel: private-chat.ZPgLCxY6

[12:32:01 AM] - ILArCPOdNHlgywZaAAAZ authenticated for: presence-chat.ZPgLCxY6

[12:32:01 AM] - ILArCPOdNHlgywZaAAAZ joined channel: presence-chat.ZPgLCxY6

(node:13265) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 13): Type
Error: Cannot set property 'socketId' of undefined

I'm using the same setup, angularjs with laravel 5.4 api and jwt-auth

Last updated 6 years ago.

Sign in to participate in this thread!


Your banner here too?

Tesseract tesseract Joined 21 Nov 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.