feat: Implement real-time chat with Reverb

This commit is contained in:
Daan Meijer
2026-06-15 00:44:55 +02:00
parent f8ee8165ff
commit 9cb87b61ef
13 changed files with 1267 additions and 5 deletions
+12
View File
@@ -0,0 +1,12 @@
<?php
use App\Models\Chat;
use Illuminate\Support\Facades\Broadcast;
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
Broadcast::channel('chats.{chat}', function ($user, Chat $chat) {
return $user->can('view', $chat->chatable);
});