Laravel Echo没有接收Pusher事件(Laravel 5.5)

时间:2017-11-05 00:18:11

标签: php laravel-5 pusher laravel-5.5 laravel-echo

我按照https://laravel.com/docs/5.5/broadcasting#using-example-application

的指南进行了操作

Laravel Echo似乎订阅得很好:

[img=http://storage4.static.itmages.com/i/17/1104/h_1509839756_8674437_f177095891.png]

我在后端发射事件:

event(new TicketMessageSent($ticket, $reply));

它们出现在pusher.com的调试控制台上:

pusher debug console showing the event

但是这次回调没有发生任何事情:

Echo.channel(`tickets.${this.ticket.id}`)
    .listen('TicketMessageSent', (e) => {
        console.log('message broadcast received: ');
        console.log(e);
    });

我正在拉扯我的声音。这可能有什么问题?

更新1

所以我在chromes控制台玩游戏,订阅chat频道并收听/绑定msg事件:

subscribing and listening

然后在Pusher.com的调试控制台中,我创建了一个事件:

firing event in pushers debug console

罗'看哪,它有效!:

received  the event!

1 个答案:

答案 0 :(得分:0)

我是耶和华。我从Laravel Backend发送的活动是在频道“门票”上,而前端正在听“门票”(复数)hahahaha!