{{-- One externally-delivered course: how to do it (website + steps), its submission status, and the certificate upload form. Shared by the course page and My Vault. Expects: $course (with requires_external_cert), $sub (latest ExternalCertificateSubmission or null), optional $showTitle (default true). --}} @php $me = auth()->user(); $canUpload = \Illuminate\Support\Facades\Route::has($me->primaryRole().'.course.external-cert.store'); $fileRoute = \Illuminate\Support\Facades\Route::has($me->primaryRole().'.external-cert.file'); $steps = collect(preg_split('/\r\n|\r|\n/', (string) $course->external_instructions))->map(fn ($s) => trim($s))->filter()->values(); $isDone = ($course->pivot->status ?? null) === 'completed'; $showTitle = $showTitle ?? true; @endphp
{{ $course->title }}
@elseComplete this training online, then upload your certificate
@endif @if($isDone) check_circle Approved — complete @elseif($sub && $sub->isPending()) hourglass_top Awaiting approval @elseif($sub && $sub->isRejected()) error Needs re-upload @else upload_file Certificate not uploaded yet @endifStep 1 — Do the training on the external website
@if($steps->isNotEmpty()){{ $course->external_url }}
@endifThis course is completed outside Segra. Ask your manager for the website link if you don't have it.
@endif {{-- Step 2: upload the certificate --}} @if($isDone)Your certificate has been approved and this course is complete.
@elseif($sub && $sub->isPending())Step 2 — done. Submitted {{ $sub->created_at->format('j M Y') }} (completed {{ optional($sub->completion_date)->format('j M Y') }}). @if($fileRoute) View my upload. @endif Your Service / Registered Manager will review it shortly.
@elseStep 2 — Upload your certificate
@if($sub && $sub->isRejected())Upload isn’t available for your account — please speak to your manager.
@endif @endif