Skip to content

Commit 7721a19

Browse files
committed
Fix channel name
1 parent de661d5 commit 7721a19

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Driver.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Aws\ApiGatewayManagementApi\Exception\ApiGatewayManagementApiException;
66
use Illuminate\Broadcasting\Broadcasters\Broadcaster;
77
use Illuminate\Broadcasting\Broadcasters\UsePusherChannelConventions;
8+
use Illuminate\Broadcasting\Channel;
89
use Illuminate\Support\Arr;
910
use Illuminate\Support\Str;
1011
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
@@ -103,9 +104,9 @@ protected function generateSignaturePresence(string $channel, string $socketId,
103104
/**
104105
* Broadcast the given event.
105106
*
106-
* @param array $channels
107-
* @param string $event
108-
* @param array $payload
107+
* @param Channel[] $channels
108+
* @param string $event
109+
* @param array $payload
109110
* @return void
110111
*
111112
* @throws \Illuminate\Broadcasting\BroadcastException
@@ -117,13 +118,13 @@ public function broadcast(array $channels, $event, array $payload = [])
117118
foreach ($channels as $channel) {
118119
$data = json_encode([
119120
'event' => $event,
120-
'channel' => $channel,
121+
'channel' => $channel->name,
121122
'data' => $payload,
122123
], JSON_THROW_ON_ERROR);
123124

124125
$this->subscriptionRepository->getConnectionIdsForChannel($channel)
125126
->reject(fn($connectionId) => $connectionId === $skipConnectionId)
126-
->tap(fn($connectionIds) => logger()->debug("Preparing to send to connections for channel '{$channel}'", $connectionIds->toArray()))
127+
->tap(fn($connectionIds) => logger()->debug("Preparing to send to connections for channel '{$channel->name}'", $connectionIds->toArray()))
127128
->each(fn(string $connectionId) => $this->sendMessage($connectionId, $data));
128129
}
129130

0 commit comments

Comments
 (0)