@php use Carbon\Carbon; if (!function_exists('getAbbreviation')) { function getAbbreviation($string) { if (!$string) return "?"; $words = explode(" ", $string); $abbreviation = ""; foreach ($words as $w) { $abbreviation .= strtoupper(substr($w, 0, 1)); } return $abbreviation; } } @endphp

Klasemen & Bagan Turnamen

{{-- Panel Grup Stage --}}
@forelse($groupsWithStandings as $group)

Klasemen {{ $group->group_name }}

@php $allTeamsInGroup = $group->teams; $standingsMap = $group->standings->keyBy('team_id'); $fullStandings = $allTeamsInGroup->map(function($team) use ($standingsMap) { $s = $standingsMap->get($team->id); return (object)[ 'team' => $team, 'played' => $s->played ?? 0, 'won' => $s->won ?? 0, 'drawn' => $s->drawn ?? 0, 'lost' => $s->lost ?? 0, 'goals_for' => $s->goals_for ?? 0, 'goals_against' => $s->goals_against ?? 0, 'points' => $s->points ?? 0, 'yellow_card' => $s->yellow_card ?? 0, 'red_card' => $s->red_card ?? 0, 'foul' => $s->foul ?? 0, 'gd' => ($s->goals_for ?? 0) - ($s->goals_against ?? 0) ]; })->sort(function($a, $b) { if ($a->points != $b->points) return $b->points <=> $a->points; if ($a->gd != $b->gd) return $b->gd <=> $a->gd; if ($a->goals_for != $b->goals_for) return $b->goals_for <=> $a->goals_for; if ($a->red_card != $b->red_card) return $a->red_card <=> $b->red_card; if ($a->yellow_card != $b->yellow_card) return $a->yellow_card <=> $b->yellow_card; return $a->foul <=> $b->foul; })->values(); @endphp @foreach ($fullStandings as $index => $standing) @php $isQualified = ($index + 1) <= 4; @endphp @endforeach
# Tim P W D L YC RC FOUL GF GA Pts
{{ $index + 1 }}
@if($standing->team->logo_url) @else
{{ getAbbreviation($standing->team->team_name) }}
@endif {{ $standing->team->team_name }}
{{ $standing->played }} {{ $standing->won }} {{ $standing->drawn }} {{ $standing->lost }} {{ $standing->yellow_card }} {{ $standing->red_card }} {{ $standing->foul }} {{ $standing->goals_for }} {{ $standing->goals_against }} {{ $standing->points }}
@empty
Belum ada data grup.
@endforelse
{{-- Panel Knockout Stage --}}