@foreach($messages as $msg) @php $isMe = ($msg->sender_id == $studentId); @endphp
@if($isMe) @else S @endif
@if(Str::startsWith($msg->message, 'http')) @if(Str::contains($msg->message, ['jpg', 'jpeg', 'png', 'gif', 'webp'])) @else Download Attachment @endif @else {{ $msg->message }} @endif {{ \Carbon\Carbon::parse($msg->created_at)->format('h:i A') }}
@endforeach