DEV Community

Discussion on: Laravel Echo not listening Event from Pusher

Collapse
 
maurobaptista profile image
Mauro Baptista

On the sample in Laravel Doc it assigns the Echo to window.Echo. laravel.com/docs/7.x/broadcasting#...

Have you tried this way?

Collapse
 
irfanullahshakir profile image
Irfan Ullah Shakir • Edited

The link you sent is for Presence Channels I am using private channels
laravel.com/docs/7.x/broadcasting#...

Collapse
 
irfanullahshakir profile image
Irfan Ullah Shakir
Echo.channel('orders')
    .listen('OrderShipped', (e) => {
        console.log(e.order.name);
    });

It gives me an error: "Echo is not defined", I also tried window.Echo

Collapse
 
shadow243 profile image
Muhindo Ngesera Steven(StyNet243)

replace Echo.channel with window.Echo.channel......