@php use App\Support\AgeingBucket; /** @var \App\Support\TenancyFilter $filter */ $target = $target ?? 'tenancies.index'; $showAll = $showAll ?? true; $showMode = $showMode ?? true; @endphp
Tenancies expiring @if ($showMode) @endif
@foreach ($buckets as $bucket) @php $isActive = $filter->bucket === $bucket; $query = $filter->toQuery(['bucket' => $isActive ? null : $bucket]); unset($query['page']); @endphp
{{ number_format($bucketCounts[$bucket] ?? 0) }}
{{ AgeingBucket::shortLabel($bucket) }}
{{ AgeingBucket::label($bucket, $filter->mode) }}
@endforeach @if ($showAll) @php $allQuery = $filter->toQuery(['bucket' => null]); unset($allQuery['page']); @endphp
{{ number_format($totalVisible ?? array_sum($bucketCounts)) }}
All
Every record you can see
@endif

@if ($filter->mode === AgeingBucket::MODE_CUMULATIVE) Counting every tenancy expiring between today and the horizon, so the figures build up as the horizon grows. Expired and TBC are counted separately. @else Each button holds only its own three-month slice, matching the worksheet columns, so the buttons add up to the total. @endif