@php
// Show months from posts table, do not duplicate and sort by latest month first
$all_months = App\Models\Post::selectRaw('DATE_FORMAT(created_at, "%M %Y") as month, COUNT(*) as post_count')
->groupBy('month')
->orderByRaw('MIN(created_at) DESC')
->get();
@endphp
@foreach($all_months as $month)
{{ $total_approved_comments }} Comments to “{{ $post->title }}”
@forelse($comments as $comment){{ $comment->name }}, {{ $comment->created_at->format('F d, Y') }}
{!! nl2br($comment->comment) !!}
Give a Reply
{{ $reply->name }} @if($reply->reply_by == 'Admin') (Admin) @endif, {{ $reply->created_at->format('F d, Y') }}
{!! nl2br($reply->reply) !!}
No comments yet.
@endforelse