@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
{{ $userInfo->name }}
@if(isset($lastMes->id))
{!! $lastMes->text !!}
@if($notRead > 0)
{!! $notRead !!}
@endif @else
Нет сообщений
@endif
@if(isset($lastMes->id)) {{ Helper::rdate('H:i',$lastMes->created_at, 1) }} @endif
@endforeach