{{-- ── En-tête ─────────────────────────────────────────────────────────── --}}

Gestion des utilisateurs

{{ number_format($users->total(), 0, ',', '\u{202f}') }} utilisateur{{ $users->total() > 1 ? 's' : '' }}

{{-- ── Barre de recherche ───────────────────────────────────────────────── --}}
@if ($search !== '') @endif
{{-- ── Tableau ──────────────────────────────────────────────────────────── --}}
@forelse ($users as $u) @php $total = $u->total_answered ?? 0; $correct = $u->correct_answered ?? 0; $pct = $total > 0 ? round($correct / $total * 100) : 0; $initials = collect(explode(' ', $u->name)) ->map(fn ($w) => mb_strtoupper(mb_substr($w, 0, 1))) ->take(2) ->implode(''); @endphp {{-- Utilisateur --}} {{-- Email --}} {{-- Inscrit le --}} {{-- Dernière connexion --}} {{-- Cours --}} {{-- Réponses --}} {{-- Score (mini barre + %) --}} {{-- Statut --}} {{-- Actions --}} @empty @endforelse
Utilisateur Score Statut Actions

{{ $u->name }}

{{-- Email visible sur mobile uniquement --}}

{{ $u->email }}

{{ $pct }} %
@if ($u->is_active) Actif @else Suspendu @endif
{{-- Détail --}} {{-- Toggle actif / suspendu --}}
@csrf @method('PATCH') @if ($u->is_active) @else @endif

@if ($search !== '') Aucun utilisateur trouvé pour « {{ $search }} » @else Aucun utilisateur trouvé @endif

@if ($search !== '') Effacer la recherche @endif
{{-- ── Pagination ───────────────────────────────────────────────────────── --}} @if ($users->hasPages())
{{ $users->onEachSide(1)->links() }}
@endif