@extends('layouts.master') @section('content')

Leaderboard

All-time cumulative scores · {{ $total }} students

Dashboard
@if($students->count() >= 3)
{{-- 2nd place --}}
{{ strtoupper(substr($students[1]->name, 0, 1)) }}
🥈

{{ explode(' ', $students[1]->name)[0] }}

{{ $students[1]->total_score }} pts
{{-- 1st place --}}
👑
{{ strtoupper(substr($students[0]->name, 0, 1)) }}

{{ explode(' ', $students[0]->name)[0] }}

{{ $students[0]->total_score }} pts
{{-- 3rd place --}}
{{ strtoupper(substr($students[2]->name, 0, 1)) }}
🥉

{{ explode(' ', $students[2]->name)[0] }}

{{ $students[2]->total_score }} pts
@endif
All Rankings
{{ $total }} students
@foreach($students as $i => $s) @php $rank = $i + 1; @endphp
@if($rank === 1) 🥇 @elseif($rank === 2) 🥈 @elseif($rank === 3) 🥉 @else {{ $rank }} @endif
{{ strtoupper(substr($s->name, 0, 1)) }}

{{ $s->name }}

{{ $s->sessions_count }} session{{ $s->sessions_count !== 1 ? 's' : '' }} · {{ $s->phone }}

{{ $s->total_score }} pts
@endforeach
@if($students instanceof \Illuminate\Pagination\LengthAwarePaginator && $students->hasPages())
{{ $students->links() }}
@endif
@endsection