@if($categories->isEmpty())

No Categories Record to Show

@else @php $catTip = function($prizes, $pos) { if (!isset($prizes) || !is_object($prizes)) return 'Prize: Not mentioned'; $col = $prizes->get($pos) ?? $prizes->get((string)$pos); if (!$col || !$col->isNotEmpty()) return 'Prize: Not mentioned'; $p = $col->first(); $posLabel = $pos === 1 ? '1st' : ($pos === 2 ? '2nd' : '3rd'); $t = $posLabel . ' Place Prize' . "\n" . '─────────────────' . "\n" . ($p->title ?? 'Not mentioned'); if (!empty($p->prize_type)) { $types = ['money' => 'Cash Prize', 'gift' => 'Gift', 'recognition' => 'Recognition', 'bonus' => 'Bonus', 'voucher' => 'Voucher', 'trophy' => 'Trophy']; $t .= "\n" . 'Type: ' . ($types[$p->prize_type] ?? ucfirst($p->prize_type)); } if (isset($p->prize_amount) && $p->prize_amount !== null && $p->prize_amount !== '') { $t .= "\n" . 'Amount: ' . ($p->currency ?? '') . ' ' . number_format((float)$p->prize_amount, 2); } if (!empty($p->description)) { $t .= "\n" . '─────────────────' . "\n" . $p->description; } return $t; }; $catTip1Html = str_replace(["\r","\n"], '
', e($catTip($prizes ?? collect(), 1))); $catTip2Html = str_replace(["\r","\n"], '
', e($catTip($prizes ?? collect(), 2))); $catTip3Html = str_replace(["\r","\n"], '
', e($catTip($prizes ?? collect(), 3))); @endphp

Top 3 Categories

Rank changes with respect to points.

@php $cat1 = $categories->get(0); $cat2 = $categories->get(1); $cat3 = $categories->get(2); @endphp {{-- Left: 2nd place --}}
2
{{ optional($cat2)->category ?? 'N/A' }}
{{ optional($cat2)->earned_points ?? 'N/A' }} pts
{{ optional($cat2)->name ?? 'N/A' }}
{{-- Middle: 1st place --}}
1
{{ optional($cat1)->category ?? 'N/A' }}
{{ optional($cat1)->earned_points ?? 'N/A' }} pts
{{ optional($cat1)->name ?? 'N/A' }}
{{-- Right: 3rd place --}}
3
{{ optional($cat3)->category ?? 'N/A' }}
{{ optional($cat3)->earned_points ?? 'N/A' }} pts
{{ optional($cat3)->name ?? 'N/A' }}
@foreach($categories as $dep) @endforeach
Rank Category Department Points Earn
{{ $loop->iteration }}
{{$dep->category}} {{$dep->name}} {{$dep->earned_points}} pts
@endif