@props(['courses', 'own' => false]) {{-- One row per enrolment; own = the viewer is the learner, so certificate links work --}} @php $labels = \App\Http\Controllers\ReportController::STATUSES; $rows = $courses->map(fn ($c) => ['text' => Str::lower($c->title.' '.$c->department), 'status' => $c->status])->values(); @endphp @if ($courses->isEmpty())

No training yet.

@if ($own) Browse courses @endif
@else
@foreach ($courses as $c) @endforeach
Course Enrolled Progress Completed Best quiz score Attempts Certificate
@if ($own) {{ $c->title }} @else

{{ $c->title }}

@endif

{{ $c->department ?? 'All staff' }}

{{ $c->pivot->created_at?->format('j M Y') }}
{{ $c->percent }}%

{{ $labels[$c->status] }}

{{ $c->completed_on?->format('j M Y') ?? '—' }} @if ($c->best_score !== null) $c->best_score >= $c->pass_mark, 'text-red-600' => $c->best_score < $c->pass_mark])>{{ $c->best_score }}% / {{ $c->pass_mark }}% @else — @endif {{ $c->attempts ?: '—' }} @if ($c->status === 'completed') @if ($own) Certificate @else Certified @endif @endif

No training matches these filters.

@endif