@php /** @var \Illuminate\Support\Collection $enrollments */ $enrollments = $this->getCertificates(); @endphp
{{-- Header --}}

@lang('app.Your Certificates')

@lang('app.All your certificates in one place.')

@if ($enrollments->isEmpty())

@lang('app.You don\'t have any certificates yet.')

@lang('app.As soon as a module is certified, it will appear here with a download link.')

@else
@foreach ($enrollments as $enrollment) @php $schedulable = $enrollment->schedulableInstance->schedulable ?? null; $certificate = $enrollment->certificate; // mimic the RelationManager logic: only make a link if we actually have certificate data $certificateUrl = $certificate && $certificate->data !== null ? route('certificates.download', ['enrollment' => $enrollment]) : null; @endphp

{{ $schedulable?->title }}

@if ($certificate && $certificate->issued_at) @lang('app.Issued') {{ $certificate->issued_at->translatedFormat('d M Y') }} @else @lang('app.Certified') @endif @if ($enrollment->unit?->number) • @lang('app.Unit') {{ $enrollment->unit->number }} @endif

@if ($certificateUrl) {{-- heroicon: arrow-down-tray --}} @lang('app.Download') @else {{-- heroicon: exclamation-circle --}} @lang('app.Not available') @endif
@endforeach
@endif