From 2e557d7b47bfed45cebd714ad7659b29d985952a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9opold=20Jacquot?= Date: Mon, 6 Feb 2023 09:51:34 +0100 Subject: [PATCH] Update Event.php --- src/Event.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Event.php b/src/Event.php index d78442f..1154164 100644 --- a/src/Event.php +++ b/src/Event.php @@ -93,7 +93,7 @@ public static function connectionEstablished(Event $event): bool return $event->getEvent() === 'pusher:connection_established'; } - public static function subscribeOn(string $channel, string $authKey = null): array + public static function subscribeOn(string $channel, string $authKey = null, string $channelData = null): array { $data = ['channel' => $channel]; @@ -101,6 +101,10 @@ public static function subscribeOn(string $channel, string $authKey = null): arr $data['auth'] = $authKey; } + if ($channelData) { + $data['channel_data'] = $channelData; + } + return ['event' => 'pusher:subscribe', 'data' => $data]; }