{{-- My Vault โ€” earned certificates + past session history. From EmployeeVaultController@index: $certificates, $sessionHistory --}} @extends('layouts.app') @section('title', 'My Vault') @section('content') @include('employee._flash') {{-- Due for renewal --}} @if($renewals->isNotEmpty())
event_repeat

Due for Renewal

{{ $renewals->count() }}

These certificates have expired or expire within {{ $renewalWindowDays }} days. Retake the training to renew.

@foreach($renewals as $cert) @php $expired = $cert->expires_at->isPast(); $days = (int) round(now()->diffInDays($cert->expires_at, false)); @endphp

{{ $cert->course->title }}

@if($expired) Expired {{ $cert->expires_at->format('j M Y') }} @else Expires {{ $cert->expires_at->format('j M Y') }} ยท in {{ $days }} {{ Str::plural('day', $days) }} @endif

View
@csrf
@endforeach
@endif {{-- Certificates --}}
workspace_premium

Certificates

({{ $certificates->count() }})
@if($certificates->isEmpty())
workspace_premium

No certificates yet

Complete a course to earn your first certificate โ€” it'll appear here.

@else
@foreach($certificates as $certificate) @php $expired = $certificate->expires_at && $certificate->expires_at->isPast(); $soon = $certificate->expires_at && ! $expired && $certificate->expires_at->lt(now()->addDays($renewalWindowDays)); @endphp
verified @if($expired) Expired @elseif($soon) Expiring soon @else Valid @endif

{{ $certificate->course?->title ?? 'Course' }}

{{ $certificate->certificate_number }}

Issued
{{ $certificate->issued_at?->format('j M Y') ?? 'โ€”' }}
Expires
{{ $certificate->expires_at?->format('j M Y') ?? 'No expiry' }}
@if($certificate->score_percent !== null)
Score
{{ $certificate->score_percent }}%
@endif
@if($certificate->course) visibility View / Download @if($expired || $soon)
@csrf
@endif @else block Course removed @endif
@endforeach
@endif {{-- Session History --}}
history

Session History

({{ $sessionHistory->count() }})
@forelse($sessionHistory as $session) @php $badge = match($session['status']) { 'attended' => ['label' => 'Attended', 'class' => 'bg-secondary-container text-on-secondary-container', 'icon' => 'check_circle'], 'no_show' => ['label' => 'Missed', 'class' => 'bg-error-container text-error', 'icon' => 'cancel'], 'cancelled' => ['label' => 'Cancelled', 'class' => 'bg-surface-container-high text-outline', 'icon' => 'block'], default => ['label' => 'Registered', 'class' => 'bg-surface-container-high text-secondary', 'icon' => 'event_available'], }; @endphp @if(!empty($session['notes'])) @endif @empty @endforelse
Session Date Time Format Outcome
{{ $session['title'] }} {{ $session['date'] }} {{ $session['time'] }} {{ $session['format'] }} {{ $badge['icon'] }} {{ $badge['label'] }}

edit_note Trainer's notes

{{ $session['notes'] }}

No past sessions on record yet.
@endsection