@extends('layouts.admin') @section('title', 'Customers') @section('heading', 'Customers') @section('subheading', $customers->total() . ' ' . Str::plural('customer', $customers->total()) . ($isFiltered ? ' matching your filters' : '')) @section('header-actions') @endsection @section('content') @php // Share-of-total lines for the cards. Derived from the counts already // fetched - no extra queries, and no figure that is not in the data. $share = fn (int $n) => $stats['total'] > 0 ? round($n / $stats['total'] * 100) . '% of customers' : 'No customers yet'; @endphp {{-- lg:h-full is what removes the dead space: the page becomes exactly the height of the viewport and the grid takes whatever the cards and filters leave, so the table fills the screen and scrolls inside itself instead of ending halfway down. Below lg the page scrolls normally. --}}
{{-- ── Statistics ──────────────────────────────────────────── --}}
{{-- ── Filters ─────────────────────────────────────────────── --}}
@if ($isFiltered) Reset @endif
{{-- Exports carry the current filters, so what downloads is what is on screen. --}} CSV Excel PDF
{{-- ── Bulk action bar ─────────────────────────────────────── --}}
@csrf
selected
Export
{{-- ── Grid ────────────────────────────────────────────────── --}} {{-- min-h-0 lets this flex child shrink so its own scroller engages instead of pushing the page taller. --}}
@if ($customers->isEmpty())
@if ($isFiltered) Reset filters @endif Add Customer
@else
@foreach ($customers as $customer) @include('customers.partials.row', ['customer' => $customer]) @endforeach
Company Contact Email Package Status Expiry Last Verification Revenue Created
{{-- ── Pagination ──────────────────────────────────── --}}
Rows
! $customers->previousPageUrl()]) aria-label="Previous page"> {{-- A window around the current page rather than every page: a hundred numbered links is not navigation. --}} @php $last = $customers->lastPage(); $current = $customers->currentPage(); $from = max(1, min($current - 2, $last - 4)); $to = min($last, max($current + 2, 5)); @endphp @if ($from > 1) 1 @if ($from > 2)…@endif @endif @for ($p = $from; $p <= $to; $p++) $p === $current, ])>{{ $p }} @endfor @if ($to < $last) @if ($to < $last - 1)…@endif {{ $last }} @endif ! $customers->nextPageUrl()]) aria-label="Next page">
@endif
{{-- ── Profile drawer ──────────────────────────────────────── --}}
@endsection