@extends('backend.template.layouts.template-base') @section('title', 'Banners') @section('content')

Banners

plus Create Banner
{{-- Filter Row --}}
Show entries
@if ($banners->isEmpty())
No banners found.
@else {{-- Banner List --}}
@foreach ($banners as $banner) @php $colId = 'banner-' . $banner->id; $groupedSections = $banner->sections->groupBy('category_id'); $catCount = $groupedSections->count(); @endphp
{{-- Header --}} {{-- Body --}}
@if ($groupedSections->isEmpty())

No categories added yet.

@else
@foreach ($groupedSections as $catId => $sections) @php $firstSec = $sections->first(); $catName = $firstSec->category?->name ?? 'Unknown'; $fromDate = $firstSec->pivot->from_date; $toDate = $firstSec->pivot->to_date; $pivotStatus = $firstSec->pivot->status ?? 'active'; $secCount = $sections->count(); $rowIdx = $loop->index; @endphp = 3 ? 'data-extra-for="' . $banner->id . '"' : '' }} style="{{ $rowIdx >= 3 ? 'display:none;' : '' }}"> @endforeach
Category Name Section Position Last Updated On Status Action
{{ $catName }} {{ $secCount }} @if ($fromDate || $toDate) @if ($fromDate && $toDate) From {{ \Carbon\Carbon::parse($fromDate)->format('d/m/Y') }} - To {{ \Carbon\Carbon::parse($toDate)->format('d/m/Y') }} @elseif($fromDate) From {{ \Carbon\Carbon::parse($fromDate)->format('d/m/Y') }} @else To {{ \Carbon\Carbon::parse($toDate)->format('d/m/Y') }} @endif @else @endif {{ ucfirst($pivotStatus) }}
@if ($catCount > 3)
@endif @endif
@endforeach
@endif
{{-- /.fb-container --}}
{{-- Remove Category Modal --}} {{-- Status Modal --}} {{-- Delete Modal --}} @endsection @section('scripts') @endsection