@foreach($chats as $chat) @php $platform = Helper::getPlatformInfo($chat->domen); $lastMes = Helper::getLastMes($chat->id, 1); if($chat->type == 'catalog'){ $catalog = Helper::findCatalog($chat->ads); $name = $catalog->name; }else{ $name = $platform->name ?? $platform->domen; } @endphp
@if($chat->type == 'ads') @else {{ mb_substr($catalog->name, 0, 1, 'utf-8'); }} @endif
{{ $name }}
@if(isset($lastMes->id))
{!! $lastMes->text !!}
@else
Нет сообщений
@endif
@if(isset($lastMes->id)) {{ Helper::rdate('d M H:i',$lastMes->created_at, 1) }} @endif
@endforeach