notificationRepo = $notificationRepository; } /** * @param Notification $notification * * @return JsonResponse */ public function readNotification(Notification $notification) { $this->notificationRepo->readNotification($notification->id); return $this->sendResponse($notification, 'Message read successfully.'); } /** * @return JsonResponse */ public function readAllNotification() { $messageSenderIds = $this->notificationRepo->readAllNotification(); return $this->sendResponse(['sender_ids' => $messageSenderIds], 'Read all messages successfully.'); } }