user()->notifications, new NotificationTransformer())->respond(); $request->user()->notifications()->whereNull('read_at')->update(['read_at' => now()]); return $result; } public function count(Request $request): JsonResponse { return response()->json(['count' => $request->user()->unreadNotifications()->count()]); } public function show(Request $request, $uuid): JsonResponse { $notification = DatabaseNotification::where('id', $uuid)->first(); $notification->markAsRead(); return fractal($notification, new NotificationTransformer())->respond(); } }