@php $notifications = []; $unreadNotifications = auth()->user()->unreadNotifications; foreach ($unreadNotifications as $notification) { $notifications[] = [ 'title' => $notification->data['data']['title'], 'message' => $notification->data['data']['message'], 'link' => $notification->data['data']['link'], 'unread' => true, 'id' => $notification->id, ]; } @endphp