From 0f0691d0375f825fa010724db52d790218cee356 Mon Sep 17 00:00:00 2001 From: lkddi Date: Sun, 1 Mar 2026 01:21:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9AFriendAdded/FriendRe?= =?UTF-8?q?moved=20=E6=94=B9=E4=B8=BA=20ShouldBroadcastNow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ShouldBroadcast 走队列(异步),不保证及时广播; ShouldBroadcastNow 不走队列,与 MessageSent 一致,立即推送到 Reverb。 这是大卡弹窗收不到的真实原因。 --- app/Events/FriendAdded.php | 4 ++-- app/Events/FriendRemoved.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Events/FriendAdded.php b/app/Events/FriendAdded.php index b7cd4f7..0ce31e9 100644 --- a/app/Events/FriendAdded.php +++ b/app/Events/FriendAdded.php @@ -18,11 +18,11 @@ namespace App\Events; use Illuminate\Broadcasting\Channel; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Broadcasting\PrivateChannel; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; +use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; -class FriendAdded implements ShouldBroadcast +class FriendAdded implements ShouldBroadcastNow { use Dispatchable, InteractsWithSockets, SerializesModels; diff --git a/app/Events/FriendRemoved.php b/app/Events/FriendRemoved.php index a6f95cf..91ad271 100644 --- a/app/Events/FriendRemoved.php +++ b/app/Events/FriendRemoved.php @@ -18,11 +18,11 @@ namespace App\Events; use Illuminate\Broadcasting\Channel; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Broadcasting\PrivateChannel; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; +use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; -class FriendRemoved implements ShouldBroadcast +class FriendRemoved implements ShouldBroadcastNow { use Dispatchable, InteractsWithSockets, SerializesModels;