@foreach($comments as $comment) @php $dep = $depth - 1; $userName = $comment->user_info['name'] ?? ($comment->user->name ?? 'Anonymous'); @endphp
parent_id != null) style="margin-left:40px;" @endif>
Avatar

{{ $userName }} {{ $comment->created_at->format('g:i a') }} {{ $comment->created_at->format('M d, Y') }}

{{ $comment->comment }}

@if($dep > 0) @endif
@php // Filter only active replies $activeReplies = $comment->replies->where('status', 'active'); @endphp @if($activeReplies && $activeReplies->count() > 0)
@include('front::pages.comment', ['comments' => $activeReplies, 'depth' => $dep])
@endif
@endforeach @if($comments->isEmpty())

No comments yet. Be the first to comment!

@endif