@php $commentsCollection = $comments ?? collect(); $commentsCount = $commentsCount ?? $commentsCollection->count(); $viewer = auth()->user(); @endphp @if($isPreview) @if($article->commentsAreEnabled())
Comments are enabled for this article, but posting is disabled in preview mode.
@endif @elseif($article->commentsAreEnabled())

Conversation

{{ number_format((int) $commentsCount) }} {{ (int) $commentsCount === 1 ? 'Comment' : 'Comments' }}

Keep the discussion focused on the article. Safe markdown formatting is supported for signed-in members.

@if(session('status'))
{{ session('status') }}
@endif @if($errors->has('body'))
{{ $errors->first('body') }}
@endif @auth
@csrf

Basic markdown is supported. Replies and reactions use the enhanced editor when JavaScript is available.

@else
Sign in to join the discussion on this article.
@endauth @if($commentsCollection->isEmpty())

No comments yet

Start the conversation if you have feedback, context, or a question about this update.

@else
@foreach($commentsCollection as $comment) @php $commentUser = $comment->user; $displayName = $commentUser?->name ?: $commentUser?->username ?: $comment->author_name ?: 'Former member'; $username = $commentUser?->username; $profileUrl = $username ? '/@' . strtolower((string) $username) : null; $canDelete = $viewer && ((int) $viewer->id === (int) $comment->user_id || (int) $viewer->id === (int) $article->author_id || $viewer->isAdmin() || $viewer->isModerator()); @endphp
@if($commentUser) {{ $displayName }} @else
{{ \Illuminate\Support\Str::upper(\Illuminate\Support\Str::substr($displayName, 0, 1)) }}
@endif
@if($profileUrl) {{ $displayName }} {{ '@' . $username }} @else {{ $displayName }} @endif

{{ optional($comment->created_at)->diffForHumans() ?? 'Unknown time' }}

@if($canDelete)
@csrf @method('DELETE')
@endif
{!! $comment->getDisplayHtml() !!}
@endforeach
@endif
@endif