@foreach($chats as $chat) @php if($chat->fuid == auth()->user()->id){ $suid = $chat->suid; }else{ $suid = $chat->fuid; } $userInfo = Helper::getUserInfo($suid); $lastMes = Helper::getLastMes($chat->id); $notRead = Helper::getCountMesView($chat->id); @endphp