@php $latestBlogs = getLatestBlogsWithTranslations(5, ['author', 'media', 'categories'], true); $latestTendingBlogs = getBlogsByMetaData( [ 'is_trending' => 1, ], 4, true, ['author', 'media', 'categories'], )['blogs']; $latestCategories = getBlogCategoriesWithTranslations(['media'], ['contents'], 8); $bannerTwo = site_configurations('theme1_ad_banner_two_section', true); @endphp @if ($latestBlogs->count() > 0)

{{ __('frontend::translate.Latest Posts') }}

@foreach ($latestBlogs as $key => $blog)
{{ $blog->title }}
{{ $blog->categories->first()->name ?? 'Uncategorized' }}

{{ getCountedWord($blog->title, 70) }}

@if ($blog?->excerpt)

{!! getCountedWord($blog?->excerpt, 130) !!}

@endif
@endforeach
@include('frontend::components.custom-home-pagination', [ 'items' => $latestBlogs, 'sectionId' => 'latest_post', ])
@if (getTranslatedData($bannerTwo, 'show_ad_banner_two') == 1)
@if (getSingleImage($bannerTwo, 'logo')) {{ siteName() }} @endif @if (getTranslatedData($bannerTwo, 'title'))

{{ getTranslatedData($bannerTwo, 'title') }}

@endif @if (getTranslatedData($bannerTwo, 'button_text') && getTranslatedData($bannerTwo, 'button_url')) {{ getTranslatedData($bannerTwo, 'button_text') }} @endif
@endif @if (count($latestTendingBlogs) > 0)

{{ __('frontend::translate.Trending Posts') }}

@foreach ($latestTendingBlogs as $blog)
{{ $blog->title }}

{{ getCountedWord($blog->title, 50) }}

{{ $blog->created_at->format('M d, Y') }}
@endforeach
@endif @if (count($latestCategories) > 0)

{{ __('frontend::translate.Categories') }}

    @foreach ($latestCategories as $category)
  • {{ $category->name }} ({{ $category->contents_count }})

  • @endforeach
@endif
@endif