@if (is_plugin_active('blog')) @if (is_plugin_active('ads')) {!! AdsManager::display('before-category-posts', ['style' => 'margin: 10px 0;']) !!} @endif @foreach (get_all_categories(['categories.status' => \Botble\Base\Enums\BaseStatusEnum::PUBLISHED, 'categories.parent_id' => 0, 'is_featured' => 1]) as $category) @php $allRelatedCategoryIds = array_unique(array_merge(app(\Botble\Blog\Repositories\Interfaces\CategoryInterface::class)->getAllRelatedChildrenIds($category), [$category->id])); $postCategories = app(\Botble\Blog\Repositories\Interfaces\PostInterface::class)->getByCategory($allRelatedCategoryIds, 0, 6); @endphp @if (count($postCategories) > 0)
{{ $category->name }}
@foreach($postCategories as $postCategory) @if ($loop->index < 3)
{{ $postCategory->name }}

{{ $postCategory->name }}

@if ($loop->first)
{{ $postCategory->created_at->translatedFormat('Y-m-d') }} @if ($postCategory->author) {{ $postCategory->author->getFullName() }} @endif
@endif
{{ $postCategory->description }}
@endif @endforeach
@foreach($postCategories as $postCategory) @if ($loop->index >= 3)

{{ $postCategory->name }}

@endif @endforeach
@endif @endforeach @if (is_plugin_active('ads')) {!! AdsManager::display('after-category-posts', ['style' => 'margin: 10px 0;']) !!} @endif @endif