@php $mapPrediction = function ($value) { return match ((string) $value) { '1', 'home', 'A', 'home_win' => 'Home Win', '2', 'away', 'B', 'away_win' => 'Away Win', '3', 'draw', 'D' => 'Draw', default => $value ?: '-', }; }; $predictions = $record->predictions ?? []; @endphp
@forelse($predictions as $prediction)
{{ $prediction->match?->homeTeam?->team_name ?? '-' }} VS {{ $prediction->match?->awayTeam?->team_name ?? '-' }}
Sport: {{ ucfirst($prediction->sport_type ?? '-') }}
Predicted: {{ $mapPrediction($prediction->prediction) }}
Final: {{ $mapPrediction($prediction->match?->result?->result_type) }}
@empty
No prediction submitted
@endforelse