@extends('layouts.landing-page.index', ['title' => 'Produk']) @section('main') {{-- Produk Produk --}} @foreach ($selectedCategories ?? [] as $categoryId) @endforeach Default Terbaru Harga Termurah Harga Termahal Nama A - Z Nama Z - A Cari Filter @if (count($catalogs) > 0) @foreach ($catalogs as $catalog) {{ $catalog->category_name }} {{-- coba pagination --}} {{-- --}} {{ $catalog->name }} {{-- {!! $catalog->description !!} --}} Mulai Dari {{ format_rupiah((int) $catalog->price) }} Harga belum termasuk diskon @endforeach @else Belum ada data @endisset {{-- Pagination --}} @if ($catalogs->hasPages()) {{-- Sebelumnya --}} @if ($catalogs->onFirstPage()) « Sebelumnya @else « Sebelumnya @endif {{-- Nomor Halaman --}} @php $current = $catalogs->currentPage(); $last = $catalogs->lastPage(); $start = max(1, $current - 2); $end = min($last, $current + 2); @endphp {{-- Halaman pertama + ellipsis kiri --}} @if ($start > 1) 1 @if ($start > 2) ... @endif @endif {{-- Window halaman --}} @for ($page = $start; $page <= $end; $page++) {{ $page }} @endfor {{-- Ellipsis kanan + halaman terakhir --}} @if ($end < $last) @if ($end < $last - 1) ... @endif {{ $last }} @endif {{-- Selanjutnya --}} @if ($catalogs->hasMorePages()) Selanjutnya » @else Selanjutnya » @endif @endif Filter Kategori {{ implode(', ', $selectedCategories ?? []) }} @if (count($categories) > 0) @foreach ($categories as $category) name, $selectedCategories ?? []) ? 'checked' : '' }}> {{ $category->name }} @endforeach @else Belum ada data @endif @endsection @push('styles') @endpush @push('scripts') @endpush
Produk