Skip to content

Commit 5dd6cd8

Browse files
feat(notifications): implement tenant-scoped broadcast notifications (EC-200)
* feat(notifications): implement tenant-scoped broadcast notifications * refactor: move tenant related code into core package --------- Co-authored-by: Omer Sabic <omer@datalinx.si>
1 parent 717d38b commit 5dd6cd8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

routes/channels.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use Eclipse\Core\Models\User;
44
use Illuminate\Support\Facades\Broadcast;
55

6-
Broadcast::channel('Eclipse.Core.Models.User.{id}', function (User $user, $id) {
7-
return (int) $user->id === (int) $id;
6+
Broadcast::channel('Eclipse.Core.Models.User.{id}.tenant.{tenantId}', function (User $user, $id, $tenantId) {
7+
return (int) $user->id === (int) $id
8+
&& $user->sites()->whereKey($tenantId)->exists();
89
});

0 commit comments

Comments
 (0)