Step 5: Real-time broadcasting (NewEmailReceived event, channel routes, Livewire listener)

This commit is contained in:
idevakk
2026-03-05 14:14:04 +05:30
parent dc5029e8cb
commit ac9e7227e6
3 changed files with 104 additions and 3 deletions

View File

@@ -2,6 +2,8 @@
use Illuminate\Support\Facades\Broadcast;
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
// Private channel: authenticated user can only listen to their own channel
Broadcast::channel('user.{id}', fn ($user, $id) => (int) $user->id === (int) $id);
// Public channel: mailbox.{domain} — no auth needed for temp email service
// The domain channel is public so guests can receive real-time updates