{{-- resources/views/issue/partials/replies.blade.php --}} {{-- Rendered on initial page load and by the issue.replies JSON endpoint (AJAX send confirmation + background polling). Bubble-chat markup, styled to match the reference messenger UI. --}} @foreach ($replies as $reply) @php $isMe = $reply->reply_by == Auth::id(); $currentDate = \Carbon\Carbon::parse($reply->created_at)->format('Y-m-d'); $prevDate = $loop->index > 0 ? \Carbon\Carbon::parse($replies[$loop->index - 1]->created_at)->format('Y-m-d') : null; $showDate = $currentDate !== $prevDate; $dateObj = \Carbon\Carbon::parse($reply->created_at); $dateLabel = $dateObj->isToday() ? 'Today' : ($dateObj->isYesterday() ? 'Yesterday' : $dateObj->format('l, j F')); $replyText = e($reply->reply); $prefix = ''; $prefixColor = ''; if (str_starts_with($replyText, 'Opening Remark:')) { $prefix = 'Opening Remark:'; $prefixColor = '#22c55e'; } elseif (str_starts_with($replyText, 'Closing Remark:')) { $prefix = 'Closing Remark:'; $prefixColor = '#ef4444'; } $replyTextWithoutPrefix = $prefix ? substr($replyText, strlen($prefix)) : $replyText; @endphp @if($showDate)