@foreach ($data as $comments) @php $replyLabel = $comments->replies ? $replyLabel + 3 : $replyLabel; @endphp
User Avatar

{{ $comments->name }}

{{ Carbon\Carbon::parse($comments->created_at)->diffForHumans() }}
@if (!is_null($comments->status))

Comment {{ $comments->status }}

@else

{{ $comments->comment }}

@endif
@php $reaction = session()->get('commentReaction', []); $action = 'like'; if (in_array($comments->id, $reaction)) { $action = 'dislike'; } else { $action = 'like'; } @endphp
@if (Auth::user())
@endif
@if ($comments->replies) @include('components.commentReply', ['data' => $comments->replies, 'replyLabel' => $replyLabel]) @endif @endforeach