@extends('layouts.landing-page.index', ['title' => 'Galeri']) @section('main') {{-- Kontak Galeri --}} Terbaru Terlama Judul A - Z Judul Z - A Cari Semua @foreach ($categories as $category) {{ $category->name }} @endforeach @foreach ($galleries as $gallery) {{-- coba pagination --}} {{-- --}} {{ $gallery->title }} {{ $gallery->category_name }} @endforeach @if ($galleries->hasPages()) {{-- Sebelumnya --}} @if ($galleries->onFirstPage()) « Sebelumnya @else « Sebelumnya @endif {{-- Nomor Halaman --}} @php $current = $galleries->currentPage(); $last = $galleries->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 ($galleries->hasMorePages()) Selanjutnya » @else Selanjutnya » @endif @endif X Tutup Galeri @endsection @push('styles') @endpush @push('scripts') @endpush
Galeri