Skip to content

Commit

Permalink
Update Event.php
Browse files Browse the repository at this point in the history
  • Loading branch information
L3o-pold authored Feb 6, 2023
1 parent e0f4340 commit 2e557d7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,18 @@ 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];

if ($authKey) {
$data['auth'] = $authKey;
}

if ($channelData) {
$data['channel_data'] = $channelData;
}

return ['event' => 'pusher:subscribe', 'data' => $data];
}

Expand Down

0 comments on commit 2e557d7

Please sign in to comment.