-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
listen does no working #237
Comments
I've solved the problem window.Echo.channel('new_order') |
I described a non-ideal but better solution here tlaverdure/laravel-echo-server#400 (comment) |
If you have everything okay in your code and your client side still didn't connect to laravel-echo-server check your socket.io-client version. |
Thanks,you solve my problem |
Thank you for your good comment. My client couldn't connect to laravel-echo-server too (I don't use https). |
That's the RIGHT solution for this, I've been looking to solve this issue for almost two days! Once I downgraded my socket.io-client to 2.3.1, it worked like a charm! Thanks a bunch! |
what is the db_prefix_new_order |
Description:
The client cannot listen the broadcast when ti is triggering
laravel-echo-server is ok
[11:06:54] - AicyyOwrtbgPNrs2AAAL joined channel: new_order
Channel: laravel_database_new_order
Event: App\Events\NewOrderEvent
Channel: laravel_database_new_order
Event: App\Events\NewOrderEvent
Steps To Reproduce:
php code
//
NewOrderEvent::broadcast(121);
class NewOrderEvent implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
}
js code
import Echo from 'laravel-echo';
...
window.io = require('socket.io-client');
window.Echo = new Echo({
broadcaster: 'socket.io',
host: 'http://localhost:6001',
});
window.Echo.channel('new_order').listen('NewOrderEvent', e => {
// can not working
console.log(e);
});
The text was updated successfully, but these errors were encountered: