fix some bugs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user