json( $this->notifications->listForUser($request->user(), (int) $request->query('page', 1), 20) ); } public function readAll(Request $request): JsonResponse { $this->notifications->markAllRead($request->user()); return response()->json(['message' => 'All notifications marked as read.']); } public function markRead(Request $request, string $id): JsonResponse { $this->notifications->markRead($request->user(), $id); return response()->json(['message' => 'Notification marked as read.']); } }