{{-- Shared v2 list controls. Each named page key owns its independent 10/all state. --}} @props(['paginator']) @if ($paginator instanceof \Illuminate\Contracts\Pagination\Paginator) @php $number = fn ($value) => number_format((int) $value, 0, ',', ' '); $lengthAware = $paginator instanceof \Illuminate\Contracts\Pagination\LengthAwarePaginator; $all = \App\Support\TablePagination::allRequested($paginator->getPageName()); $text = $lengthAware ? __('nh.showing', ['from' => $number($paginator->firstItem()), 'to' => $number($paginator->lastItem()), 'total' => $number($paginator->total())]) : __('nh.page', ['current' => $number($paginator->currentPage())]); $toggleUrl = $paginator->url($all ? 1 : 'all'); @endphp @if ($paginator->hasPages() || ($all && $lengthAware && $paginator->total() > 10)) @endif @endif