@php use App\Services\Translator; $fx = $match['fixture'] ?? []; $teams = $match['teams'] ?? []; $goals = $match['goals'] ?? []; $leagueInfo = $match['league'] ?? []; $statusData = $fx['status'] ?? []; $statusShort = $statusData['short'] ?? 'NS'; $elapsed = $statusData['elapsed'] ?? null; $isLive = in_array($statusShort, ['1H','2H','HT','ET','BT','P','LIVE','INT']); $isFinished = in_array($statusShort, ['FT','AET','PEN']); $home = $teams['home'] ?? []; $away = $teams['away'] ?? []; $homeName = Translator::team($home['name'] ?? ''); $awayName = Translator::team($away['name'] ?? ''); $round = $leagueInfo['round'] ?? ''; $leagueName = Translator::league($leagueInfo['name'] ?? '', $leagueInfo['country'] ?? null); $matchDate = null; try { if (!empty($fx['date'])) $matchDate = \Carbon\Carbon::parse($fx['date']); } catch (\Exception $e) {} $dateStr = $matchDate ? $matchDate->format('Y-m-d') : ''; $timeStr = $matchDate ? $matchDate->setTimezone('Africa/Tunis')->format('H:i') : ''; @endphp {{-- Header: league name + round + date (team mode) --}}
{{ $leagueName }} • {{ $formatRound($round) }} @if($dateStr) {{ $dateStr }} @endif
{{-- Match row --}}
{{ $homeName }}
@if(!empty($home['logo'])) @else @endif
@if($isLive)
{{ $goals['home'] ?? 0 }}
@php $elapsed = min(90, max(0, $elapsed ?? 0)); $circumference = 2 * M_PI * 15; $remaining = $circumference - ($elapsed / 90) * $circumference; @endphp {{ $elapsed }}'
{{ $goals['away'] ?? 0 }}
@elseif($isFinished)
{{ __('messages.finished') }}
{{ $goals['home'] ?? 0 }} - {{ $goals['away'] ?? 0 }}
@else
{{ $matchDate ? $matchDate->translatedFormat('d M') : '' }}
{{ $timeStr }}
@endif
@if(!empty($away['logo'])) @else @endif
{{ $awayName }}