动态的Laravel回声听众
我将Laravel Echo与LiveWire这样的使用。
protected function getListeners()
{
$listeners=[];
if($this->posts !== null)
foreach($this->posts as $post){
$listeners["echo:update-post-$post->id,UpdatePostEvent"]='updatePost';
}
return $listeners;
}
事件运行时。所有听那个频道的用户都会收到此错误:
Undefined array key "echo:update-post-1,UpdatePostEvent".
有人知道为什么会发生这种错误?
I'm using Laravel echo with Livewire like this.
protected function getListeners()
{
$listeners=[];
if($this->posts !== null)
foreach($this->posts as $post){
$listeners["echo:update-post-$post->id,UpdatePostEvent"]='updatePost';
}
return $listeners;
}
when the event runs. All users who listening to that channel got this error:
Undefined array key "echo:update-post-1,UpdatePostEvent".
Anyone know why is this happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论