Requests ({{count($downloadRequest)}})

@php $tabs = [ 'all' => 'All', 'pending' => 'Pending', 'approved' => 'Approved', 'declined' => 'Declined', ]; $activeTab = request('status', 'all'); @endphp @foreach ($tabs as $key => $label) {{ $label }} @endforeach
@php $requests = []; // Generate the request data foreach (range(1, 15) as $i) { $statuses = [ 'pending' => 'Waiting for approval', 'approved' => 'Ready to download', 'declined' => 'Declined', ]; $statusKey = array_rand($statuses); $requests[] = [ 'title' => 'Request for DTR Approval', 'statusKey' => $statusKey, 'statusText' => $statuses[$statusKey], 'statusColor' => $statusKey === 'approved' ? 'text-green-500' : ($statusKey === 'pending' ? 'text-blue-500' : 'text-red-500'), 'date' => strtotime('2025-02-' . (20 - $i)), // Convert date to timestamp for sorting 'formattedDate' => 'Feb ' . (20 - $i) . ', 2025', // Display format ]; } // Sort the requests by date (latest first) usort($requests, fn($a, $b) => $b['date'] <=> $a['date']); $rowNumber = 1; // Initialize numbering @endphp @foreach ($downloadRequest as $request) @if ($activeTab === 'all' || $activeTab === $request['statusKey']) @endif @endforeach
# Title Status Date Requested Actions
{{ $rowNumber++ }} {{ $request['title'] }} {{ $request['statusText'] }} {{ $request['formattedDate'] }}
View
@if ($request['statusKey'] === 'approved')
Download
@endif

No pagination yet.