15 lines
534 B
PHP
15 lines
534 B
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Broadcast;
|
|
|
|
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
|
|
return (int) $user->id === (int) $id;
|
|
});
|
|
|
|
// Household-wide live updates — any authenticated user of this single-household system.
|
|
Broadcast::channel('home', fn ($user) => $user !== null);
|
|
|
|
// Per-device / per-room channels (used by detail views).
|
|
Broadcast::channel('devices.{uuid}', fn ($user, string $uuid) => $user !== null);
|
|
Broadcast::channel('rooms.{uuid}', fn ($user, string $uuid) => $user !== null);
|