Dashboard @php $user = auth()->user(); $elo = $user->elo ?? 1200; $div = getDivision($elo); $total = ($user->wins + $user->losses + $user->draws) ?: 1; $winRate = round($user->wins / $total * 100, 1); @endphp
avatar
Selamat datang, {{ $user->username }}!
Season 1 · {{ now()->format('d M Y') }}
{{ $div['icon'] }} {{ $div['name'] }}
Find Match
{{ number_format($elo) }}
ELO Rating
{{ $user->wins ?? 0 }}
Wins
{{ $user->losses ?? 0 }}
Losses
{{ $winRate }}%
Win Rate
Pertandingan Terakhir
Lihat Semua
@forelse($recentMatches ?? [] as $match) @php $isHost = $match->host_id === $user->id; $myScore = $isHost ? $match->score_host : $match->score_guest; $opScore = $isHost ? $match->score_guest : $match->score_host; $opUser = $isHost ? $match->guest : $match->host; $won = $match->winner_id === $user->id; $draw = is_null($match->winner_id) && $match->status === 'completed'; @endphp
{{ $draw ? 'D' : ($won ? 'W' : 'L') }}
vs {{ $opUser?->username }}
{{ $match->created_at->diffForHumans() }}
{{ $myScore }} – {{ $opScore }}
@empty
Belum ada pertandingan.
Cari Lawan Sekarang
@endforelse
Rank Progress
@php $nextElo = collect([1000,1300,1600,1900,2200,2500,9999])->first(fn($t) => $t > $elo) ?? 9999; $prevElo = collect([0,1000,1300,1600,1900,2200,2500])->last(fn($t) => $t <= $elo) ?? 0; $pct = $nextElo < 9999 ? round(($elo - $prevElo) / ($nextElo - $prevElo) * 100) : 100; @endphp
{{ $div['icon'] }} {{ $div['name'] }} {{ number_format($elo) }} ELO
{{ $prevElo }} {{ $nextElo < 9999 ? $nextElo : '∞' }}
@if($nextElo < 9999)
{{ $nextElo - $elo }} ELO lagi ke divisi berikutnya
@endif
Top Players
Full →
@forelse($topPlayers ?? [] as $i => $p)
@if($i < 3) {{ ['🥇','🥈','🥉'][$i] }} @else {{ $i+1 }} @endif {{ $p->username }} {{ number_format($p->elo) }}
@empty
Belum ada data
@endforelse
Grafik ELO
10 pertandingan terakhir
@push('scripts') @endpush