Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 15, 2019
1 parent 8597486 commit 2faadcd
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,19 @@ public function broadcastOn()
return $channels;
}

$channelNames = $this->channelName();
if (is_string($channelNames)) {
return [new PrivateChannel($channelNames)];
if (is_string($channels = $this->channelName())) {
return [new PrivateChannel($channels)];
}

$channels = [];
foreach ($channelNames as $channel) {
$channels[] = new PrivateChannel($channel);
}

return $channels;
return collect($channels)->map(function ($channel) {
return new PrivateChannel($channel);
})->all();
}

/**
* Get the broadcast channel name for the event.
*
* @return string|array
* @return array|string
*/
protected function channelName()
{
Expand Down

0 comments on commit 2faadcd

Please sign in to comment.