where("chat_message_id",$chat_message_id)->where("viewed",false)->countAllResults(); if($count>0){ $status = false; }else{ $status = true; } return $status; } public function setNotificationsAsViewed(array $notificationIds) : bool { return $this->update($notificationIds,["viewed" => 1]); } public function setNotificationsAsUnViewed(array $notificationIds) : bool { return $this->update($notificationIds,["viewed" => 0]); } }