fix: channels

feat: database backup is realtime now
This commit is contained in:
Andras Bacsai committed 2023-12-11 10:23:10 +01:00
1 parent 63dff5961e
commit 3ffd3fc819
15 files changed
+81 -26

No files matched your search

+8 -1
View File
@@ -15,9 +15,16 @@ use App\Models\Application;
use App\Models\User;
use Illuminate\Support\Facades\Broadcast;
Broadcast::channel('custom.{teamId}', function (User $user, int $teamId) {
Broadcast::channel('team.{teamId}', function (User $user, int $teamId) {
if ($user->teams->pluck('id')->contains($teamId)) {
return true;
}
return false;
});
Broadcast::channel('user.{userId}', function (User $user) {
if ($user->id === auth()->user()->id) {
return true;
}
return false;
});