I am using Laravel to broadcast to multiple channels at once, and now want to use e2e. Previously I would trigger one event broadcast to many different channels in one job by returning an array of private channels.
Would you be willing to consider a PR to allow events to be triggered on multiple encrypted channels? I have read the rationale in the readme however could it be possible to check that the specified channels are not a mixture of encrypted/unencrypted channels and if so just throw an exception?
Something like:
if ($has_encrypted_channel) {
if (PusherCrypto::has_mixed_channels($channels)) {
throw new PusherException('You cannot trigger to multiple channels of different encryption type');
} else {
try {
$data_encoded = $this->crypto->encrypt_payload(
$channels[0],
$already_encoded ? $data : json_encode($data, JSON_THROW_ON_ERROR)
);
} catch (\JsonException $e) {
throw new PusherException('Data encoding error.');
}
}
} else {
try {
$data_encoded = $already_encoded ? $data : json_encode($data, JSON_THROW_ON_ERROR);
} catch (\JsonException $e) {
throw new PusherException('Data encoding error.');
}
}
Alternatively it could be handled when validating the channels and throw in a different location?
I am using Laravel to broadcast to multiple channels at once, and now want to use e2e. Previously I would trigger one event broadcast to many different channels in one job by returning an array of private channels.
Would you be willing to consider a PR to allow events to be triggered on multiple encrypted channels? I have read the rationale in the readme however could it be possible to check that the specified channels are not a mixture of encrypted/unencrypted channels and if so just throw an exception?
Something like:
Alternatively it could be handled when validating the channels and throw in a different location?
Thanks. 👍