@php // ✅ Group vacancies by category and sort alphabetically (same as PDF) $groupedVacancies = $vacancies ->sortBy(fn($job) => $job->category->name ?? 'Unknown') ->groupBy(fn($job) => $job->category->name ?? 'Uncategorized'); // ✅ Compute grand total of available vacancies $grandTotal = $vacancies->sum('available'); @endphp @forelse ($groupedVacancies as $categoryName => $jobs) @foreach ($jobs as $job) @endforeach @empty @endforelse @if ($vacancies->count() > 0) @endif
{{ $title }}
Generated on: {{ $generated_at }}
Date Range: {{ $filters['dateRange'] ?? 'All Dates' }}
Company Name Position Qualification Work Experience Salary Vacants
{{ $categoryName }}
{{ $job->employer->user->name ?? 'N/A' }} {{ $job->title }} {{ $job->jobQualify->name ?? 'N/A' }} {{ $job->job_experience ? $job->job_experience . ' year(s)' : 'N/A' }} {{ $job->salary ?? 'N/A' }} {{ $job->available ?? 0 }}
No job vacancies found.
Overall Total Vacancies {{ $grandTotal }}