{{-- Daftar berformat SATU dengan paginasi server (untuk data yang barisnya mahal dihitung): filter, cari, dan halaman lewat GET. Opsional: $perOptions (pilihan data per halaman, bawaan 10/25), $searchPlaceholder, filter bertipe 'date' atau 'hidden' (ikut terkirim tanpa ditampilkan) selain 'select'. --}} @php $query = request()->query('q'); $query = is_string($query) ? $query : ''; $last = $rows->lastPage(); $current = $rows->currentPage(); $start = max(1, min($current - 2, $last - 4)); $window = range($start, $start + min(5, $last) - 1); $per = $rows->perPage(); $perOptions ??= [10, 25]; $hiddenFilters = array_filter($filters, fn (array $f): bool => ($f['type'] ?? 'select') === 'hidden'); $visibleFilters = array_filter($filters, fn (array $f): bool => ($f['type'] ?? 'select') !== 'hidden'); @endphp {{-- Kontrol memakai atribut form="satu-form" agar tabel (dengan tautan dan formulir aksi) tidak berada di dalam formulir pencarian. --}}
@if ($visibleFilters)
@foreach ($visibleFilters as $filter) @if (($filter['type'] ?? 'select') === 'date') @else @endif @endforeach
@endif
@if ($searchable) @endif
@foreach ($columns as $col) @endforeach @foreach ($rows as $row) @php $id = $keyOf($row); @endphp @foreach ($columns as $col) @php $val = isset($col['value']) ? $col['value']($row) : data_get($row, $col['key']); $tone = isset($col['badge']) ? $col['badge']($row) : null; @endphp @endforeach @endforeach
($col['class'] ?? null) === 'num'])>{{ $col['label'] }}Aksi
($col['class'] ?? null) === 'num', 'table__title' => $loop->first])> @if ($tone !== null && $val !== null && $val !== '') {{ $val }} @else {{ $val === null || $val === '' ? '-' : $val }} @endif @foreach ($rowActions($row) as $action) {{ $action['label'] }} @endforeach @if ($abilities['show']) @endif
@if ($rows->isEmpty())

{{ request()->query() ? 'Tidak ada data yang cocok dengan pencarian atau filter.' : 'Belum ada data '.Str::lower($names['plural']).'.' }}

@endif

Halaman {{ $current }} dari {{ $last }} ({{ $rows->total() }} data)