fix some bugs

This commit is contained in:
2026-07-29 17:00:51 +03:30
parent dd77e2ce81
commit 16b947adc5
6 changed files with 138 additions and 44 deletions
@@ -89,14 +89,17 @@ class CustomerAppNotifyService
private function broadcastToCustomer(AppNotification $row, int $customerId): void
{
$unread = app(AppNotificationUnreadService::class);
$payload = [
'id' => $row->id,
'title' => $row->title,
'body' => $row->body,
'severity' => $row->severity,
'created_at' => optional($row->created_at)?->toIso8601String(),
'unread_count' => $unread->countForCustomer($customerId),
];
$this->stream->publishForCustomer($customerId, 'app_notification', $payload);
$unread->publishForCustomer($customerId);
}
}