修复:全员清屏广播不生效

- ScreenCleared 改用 ShouldBroadcastNow 绕过队列,避免 Horizon 未重启问题
- Echo 监听移入 DOMContentLoaded + 500ms 重试,确保 window.Echo 就绪后再注册
- 添加 console.log 便于调试
This commit is contained in:
2026-02-26 23:43:09 +08:00
parent f92fae599e
commit 62b963fb9b
2 changed files with 13 additions and 4 deletions
+2 -2
View File
@@ -14,11 +14,11 @@ namespace App\Events;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class ScreenCleared implements ShouldBroadcast
class ScreenCleared implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;