chore: fix forloop

This commit is contained in:
Chirag Aggarwal 2025-02-26 16:50:12 +00:00
parent 0ddcb9b14c
commit 28896081d7

View file

@ -86,17 +86,19 @@ class Realtime extends Event
? $this->getTargets()
: [$target['projectId'] ?? $this->getProject()->getId()];
RealtimeAdapter::send(
projectId: $projectIds,
payload: $this->getRealtimePayload(),
events: $allEvents,
channels: $target['channels'],
roles: $target['roles'],
options: [
'permissionsChanged' => $target['permissionsChanged'],
'userId' => $this->getParam('userId')
]
);
foreach ($projectIds as $projectId) {
RealtimeAdapter::send(
projectId: $projectId,
payload: $this->getRealtimePayload(),
events: $allEvents,
channels: $target['channels'],
roles: $target['roles'],
options: [
'permissionsChanged' => $target['permissionsChanged'],
'userId' => $this->getParam('userId')
]
);
}
return true;
}