@if ($allPosts->count() > 0)
@foreach ($allPosts->take(5) as $post)
{!! $post->title !!}

{!! \Illuminate\Support\Str::limit($post->description, 80, '...') !!}

{{ ucfirst(__('messages.common.' . strtolower($post->created_at->format('F')))) }}{{ $post->created_at->format(' d, Y') }}
@if ($post->post_types == \App\Models\Post::ARTICLE_TYPE_ACTIVE || $post->post_types == \App\Models\Post::OPEN_AI_ACTIVE) {{ getReadingTime( $post->postArticle?->article_content ? $post->postArticle->article_content : $post->description, ) }} @elseif ($post->post_types == \App\Models\Post::GALLERY_TYPE_ACTIVE) {{ getReadingTime($allContent) }} @elseif ($post->post_types == \App\Models\Post::SORTED_TYPE_ACTIVE) {{ getReadingTime($allContent) }} @elseif ($post->post_types == \App\Models\Post::VIDEO_TYPE_ACTIVE) {{ getReadingTime($post->postVideo->video_content) }} @elseif ($post->post_types == \App\Models\Post::AUDIO_TYPE_ACTIVE) {{ getReadingTime($post->postAudios->audio_content) }} @endif
@endforeach
@if (checkAdSpaced('popular_news')) @if (isset(getAdImageMobile(\App\Models\AdSpaces::ALL_DETAILS_POPULAR_NEWS_THEME_1)->code))
{!! getAdImageMobile(\App\Models\AdSpaces::ALL_DETAILS_POPULAR_NEWS_THEME_1)->code !!}
@elseif ($adRecord = getAdImageMobile(\App\Models\AdSpaces::ALL_DETAILS_POPULAR_NEWS_THEME_1)) @endif @endif
@if (count(getPopularNews()))
@if (!empty(array_filter(getPopularNews()))) @include('theme1.most_read', [ 'popularNews' => array_slice(getPopularNews(), 0, 6), ]) @endif
@endif
@foreach ($allPosts->skip(5) as $post) @if (($loop->index + 1) % 5 == 0)
@if (checkAdSpaced('categories'))
@if (isset(getAdImageDesktop(\App\Models\AdSpaces::CATEGORIES_THEME_1)->code))
{!! getAdImageDesktop(\App\Models\AdSpaces::CATEGORIES_THEME_1)->code !!}
@elseif ($adRecord = getAdImageDesktop(\App\Models\AdSpaces::CATEGORIES_THEME_1)) @endif
@endif
@endif @endforeach
@foreach ($allPosts->skip(5)->take(3) as $post)
{!! $post->title !!}

{!! \Illuminate\Support\Str::limit($post->description, 80, '...') !!}

{{ ucfirst(__('messages.common.' . strtolower($post->created_at->format('F')))) }}{{ $post->created_at->format(' d, Y') }}
@if ($post->post_types == \App\Models\Post::ARTICLE_TYPE_ACTIVE || $post->post_types == \App\Models\Post::OPEN_AI_ACTIVE) {{ getReadingTime( $post->postArticle?->article_content ? $post->postArticle->article_content : $post->description, ) }} @elseif ($post->post_types == \App\Models\Post::GALLERY_TYPE_ACTIVE) {{ getReadingTime($allContent) }} @elseif ($post->post_types == \App\Models\Post::SORTED_TYPE_ACTIVE) {{ getReadingTime($allContent) }} @elseif ($post->post_types == \App\Models\Post::VIDEO_TYPE_ACTIVE) {{ getReadingTime($post->postVideo->video_content) }} @elseif ($post->post_types == \App\Models\Post::AUDIO_TYPE_ACTIVE) {{ getReadingTime($post->postAudios->audio_content) }} @endif
@endforeach
@if (count(getPopularTags()))
@include('theme1.popular_tag')
@endif
@include('theme1.advertiesment.detail-side')
@if ($allPosts->count() > 0) {{ $allPosts->links('pagination::tailwind-theme-1') }} @endif
@if (checkAdSpaced('categories'))
@if (isset(getAdImageDesktop(\App\Models\AdSpaces::CATEGORIES_THEME_1)->code))
{!! getAdImageDesktop(\App\Models\AdSpaces::CATEGORIES_THEME_1)->code !!}
@elseif ($adRecord = getAdImageDesktop(\App\Models\AdSpaces::CATEGORIES_THEME_1)) @endif
@endif
@else

{{ __('messages.no_matching_records_found') }}

@endif