@extends('layouts.public') @section('title', $site['name']) @section('content') @php $filledSections = $sections->filter(fn ($section) => $section->articles->isNotEmpty())->values(); $leadItems = $latest->reject(fn ($item) => $lead && $item->id === $lead->id)->values(); $topBoxes = $filledSections->take($homeSettings['box_count'] ?? 3); $featureSection = $filledSections->firstWhere('slug', $homeSettings['feature_category'] ?? 'country') ?? $filledSections->get($homeSettings['box_count'] ?? 3); $splitSection = $filledSections->firstWhere('slug', $homeSettings['split_category'] ?? 'crime') ?? $filledSections->get(($homeSettings['box_count'] ?? 3) + 1); $tileSections = $filledSections->reject(fn ($section) => $topBoxes->contains('id', $section->id)) ->reject(fn ($section) => $featureSection && $section->id === $featureSection->id) ->reject(fn ($section) => $splitSection && $section->id === $splitSection->id) ->values(); @endphp
@foreach($topBanners as $banner) @endforeach @if($breaking->isNotEmpty())
শিরোনাম{{ $breaking->pluck('title')->join(' | ') }}
@endif
@if($lead) @endif @foreach($leadItems->take(4) as $article) @endforeach
@foreach($leadItems->skip(4)->take(6) as $article) @endforeach
@foreach($middleBanners as $banner) @endforeach
@if($topBoxes->isNotEmpty())
@foreach($topBoxes as $section) @php $firstArticle = $section->articles->first(); @endphp

{{ $section->name }}

@if($firstArticle?->image_path) {{ $firstArticle->title }} @endif
@endforeach
@endif @if($featureSection)

{{ $featureSection->name }}

@php $featureLead = $featureSection->articles->first(); @endphp @if($featureLead) @endif
@foreach($featureSection->articles->skip(1)->take(6) as $article) @endforeach
@endif @if($splitSection)

{{ $splitSection->name }}

@php $splitLead = $splitSection->articles->first(); @endphp @if($splitLead) @endif
@foreach($splitSection->articles->skip(1)->take(4) as $article) @endforeach
@endif @if($tileSections->isNotEmpty())
@foreach($tileSections->take($homeSettings['tile_count'] ?? 12) as $section) @php $article = $section->articles->first(); @endphp @if($article)

{{ $section->name }}

@if($article->image_path){{ $article->title }}@endif

{{ $article->title }}

@endif @endforeach
@endif @endsection