3 回答

TA贡献1804条经验 获得超8个赞
代替 :
public function receivesBroadcastNotificationsOn()
{
return 'App.User.'.$this->id;
return 'YouthAdd.YouthAdd.'.$this->id;
}
尝试这个:
public function receivesBroadcastNotificationsOn()
{
return [
'App.User.'.$this->id,
'YouthAdd.YouthAdd.'.$this->id
];
}

TA贡献1804条经验 获得超3个赞
这对我有用。
$channels = array();
foreach ($this->athletes as $athlete) {
array_push($channels, new PrivateChannel('athlete.' . $athlete->user->id));
}
array_push($channels, new PrivateChannel('user.' . $this->user->id));
return $channels;

TA贡献1877条经验 获得超1个赞
尝试这个:
$channelNames = ['App.User.' . $this->id, 'YouthAdd.YouthAdd.'.$this->id];
$channels = [];
foreach ($channelNames as $channel) {
$channels[] = new PrivateChannel($channel);
}
return $channels;
- 3 回答
- 0 关注
- 149 浏览
添加回答
举报