{{-- Shared header + filter for the hub-based report pages. Expects: $active (route name), $title, $subtitle, $mode ('range'|'date') $from,$to (range) or $date (date) --}} @php $baseParams = match ($mode) { 'date' => ['date' => $date], 'none' => [], default => ['from' => $from, 'to' => $to], }; $printParams = $baseParams + ['print' => 1]; @endphp
All Reports

{{ $title }}

@if(!empty($subtitle))

{{ $subtitle }}

@endif
@if($mode === 'none') {{-- live snapshot — no date filter --}} @elseif($mode === 'date')
@if($date !== now()->toDateString()) Today @endif
@else
@php $presets = [ 'This Month' => ['from' => now()->startOfMonth()->toDateString(), 'to' => now()->toDateString()], 'Last Month' => ['from' => now()->subMonth()->startOfMonth()->toDateString(), 'to' => now()->subMonth()->endOfMonth()->toDateString()], 'Last 30d' => ['from' => now()->subDays(29)->toDateString(), 'to' => now()->toDateString()], ]; @endphp @foreach($presets as $label => $params) @php $isActive = $from === $params['from'] && $to === $params['to']; @endphp {{ $label }} @endforeach
@endif CSV Excel Print