5
5
use Aws \ApiGatewayManagementApi \Exception \ApiGatewayManagementApiException ;
6
6
use Illuminate \Broadcasting \Broadcasters \Broadcaster ;
7
7
use Illuminate \Broadcasting \Broadcasters \UsePusherChannelConventions ;
8
+ use Illuminate \Broadcasting \Channel ;
8
9
use Illuminate \Support \Arr ;
9
10
use Illuminate \Support \Str ;
10
11
use Symfony \Component \HttpKernel \Exception \AccessDeniedHttpException ;
@@ -103,9 +104,9 @@ protected function generateSignaturePresence(string $channel, string $socketId,
103
104
/**
104
105
* Broadcast the given event.
105
106
*
106
- * @param array $channels
107
- * @param string $event
108
- * @param array $payload
107
+ * @param Channel[] $channels
108
+ * @param string $event
109
+ * @param array $payload
109
110
* @return void
110
111
*
111
112
* @throws \Illuminate\Broadcasting\BroadcastException
@@ -117,13 +118,13 @@ public function broadcast(array $channels, $event, array $payload = [])
117
118
foreach ($ channels as $ channel ) {
118
119
$ data = json_encode ([
119
120
'event ' => $ event ,
120
- 'channel ' => $ channel ,
121
+ 'channel ' => $ channel-> name ,
121
122
'data ' => $ payload ,
122
123
], JSON_THROW_ON_ERROR );
123
124
124
125
$ this ->subscriptionRepository ->getConnectionIdsForChannel ($ channel )
125
126
->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 ()))
127
128
->each (fn (string $ connectionId ) => $ this ->sendMessage ($ connectionId , $ data ));
128
129
}
129
130
0 commit comments