Suc*_*Man 1 notifications real-time broadcasting laravel laravel-5.3
我在这里阅读:https://laravel.com/docs/5.4/broadcasting#concept-overview
那里解释说它可以使用公共频道。但是没有如何使用它的示例
我只是看到一个像这样的私人频道的示例:
public function broadcastOn()
{
return new PrivateChannel('user.'.$this->user->id);
}
Run Code Online (Sandbox Code Playgroud)
我需要一个公开频道的真实例子
我尝试搜索,但尚未找到
有没有人可以帮忙?
您必须返回Channel:
public function broadcastOn()
{
return new use Illuminate\Broadcasting\Channel('myPublicChannelName');
}
Run Code Online (Sandbox Code Playgroud)
可以在这里找到一个示例:https : //petericebear.github.io/starting-laravel-echo-20170303/
| 归档时间: |
|
| 查看次数: |
3364 次 |
| 最近记录: |