@php $todayStr = now()->format('Y-m-d'); $yesterdayStr = now()->subDay()->format('Y-m-d'); $last7From = now()->subDays(6)->format('Y-m-d'); $weekFrom = now()->startOfWeek()->format('Y-m-d'); $thisMonthFrom = now()->startOfMonth()->format('Y-m-d'); $activePreset = ''; if ($dateFrom === $dateTo && $dateFrom === $todayStr) { $activePreset = 'today'; } elseif ($dateFrom === $dateTo && $dateFrom === $yesterdayStr) { $activePreset = 'yesterday'; } elseif ($dateFrom === $last7From && $dateTo === $todayStr) { $activePreset = 'last7'; } elseif ($dateFrom === $weekFrom && $dateTo === $todayStr) { $activePreset = 'week'; } elseif ($dateFrom === $thisMonthFrom && $dateTo === $todayStr) { $activePreset = 'this_month'; } $selectedCourierIds = array_map('intval', (array) request('courier_ids', [])); $presets = [ 'today' => 'Today', 'yesterday' => 'Yesterday', 'last7' => 'Last 7 Days', 'week' => 'This Week', 'this_month' => 'This Month', ]; @endphp
Report Filters Select date, courier & status
Quick Date
@foreach($presets as $key => $label) @endforeach