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 關注
- 148 瀏覽
添加回答
舉報