@if($recipientUser) {{ $recipientUser->name }} В сети 37 минут назад @endif
@foreach($messages as $message) @php $author = App\Models\User::find($message['from_user_id']); $authorPhoto = $author->profile_photo_url; $isAuthorPost = $curUserId == $message['from_user_id']; if (is_string($message['created_at'])) { $createdAt = Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $message['created_at'])->setTimezone('Europe/Moscow')->diffForHumans(); } else { $createdAt = $message['created_at']->setTimezone('Europe/Moscow')->diffForHumans(); } @endphp
@if(!$isAuthorPost) @endif
{{ $author->name }} {{ $createdAt }}
{{ $message['data'] }}
@if($isAuthorPost) @endif
@endforeach