{{-- Learning Plan / CPD Journey — a single course. From EmployeeCourseController@plan: $course = Course with ->pivot (status live) and ->modules $pace = recommended-pace + on-track summary (see controller) $weekly = [ ['label','range','target','rec_minutes','actual_minutes','actual_pct','status'], ... ] $monthly = same shape, month buckets --}} @extends('layouts.app') @section('title', 'Learning Plan') @section('content') @include('employee._flash') @php $showRoute = auth()->user()->learnRoute('course.show', $course->slug); $fmt = function ($min) { $min = max(0, (int) round($min)); if ($min < 60) return $min . ' min'; $h = intdiv($min, 60); $m = $min % 60; return $m ? $h . 'h ' . $m . 'm' : $h . 'h'; }; @endphp {{-- Header --}}
arrow_back Back to course

{{ $course->title }}

Your CPD learning plan — what to complete, by when, and whether you're on track.

play_arrow Continue course
{{-- ── On-track banner ──────────────────────────────────────────────── --}} @php if ($pace['completed']) { $banner = ['tone' => 'ok', 'icon' => 'verified', 'title' => 'Course complete — well done!', 'text' => 'You finished this course. Your certificate is on the course page.']; } elseif ($pace['overdue']) { $banner = ['tone' => 'bad', 'icon' => 'error', 'title' => 'This course is overdue', 'text' => 'The deadline has passed — aim to complete the remaining ' . $fmt($pace['remaining_work_minutes']) . ' of learning as soon as you can.']; } elseif ($pace['on_track'] === null) { $banner = ['tone' => 'neutral', 'icon' => 'schedule', 'title' => 'No deadline set', 'text' => 'There\'s no due date on this course. A steady pace of ' . $fmt($pace['per_week_minutes']) . ' per week will see it done comfortably.']; } elseif ($pace['on_track']) { $banner = ['tone' => 'ok', 'icon' => 'trending_up', 'title' => 'You\'re on track', 'text' => 'You\'re at ' . $pace['progress_pct'] . '% and the plan expects ' . $pace['expected_pct'] . '% by now. Keep it up.']; } else { $banner = ['tone' => 'warn', 'icon' => 'warning', 'title' => 'You\'re a little behind', 'text' => 'You\'re at ' . $pace['progress_pct'] . '% but the plan expects ' . $pace['expected_pct'] . '% by now (' . abs($pace['gap_pct']) . '% behind). Pick up the pace below to catch up.']; } $bannerClass = [ 'ok' => 'bg-secondary-container/60 border-secondary text-on-secondary-container', 'warn' => 'bg-gold/10 border-gold text-[#8a6d3b]', 'bad' => 'bg-error-container/60 border-error text-error', 'neutral' => 'bg-surface-container-high border-outline-variant text-on-surface-variant', ][$banner['tone']]; @endphp
{{ $banner['icon'] }}

{{ $banner['title'] }}

{{ $banner['text'] }}

{{-- ── Recommended pace: key numbers ────────────────────────────────── --}}
@php $daysValue = $pace['completed'] ? '—' : ($pace['due'] === null ? '—' : ($pace['overdue'] ? abs($pace['remaining_days']) . ' overdue' : max(0, $pace['remaining_days']))); $cards = [ ['icon' => 'event', 'tone' => $pace['overdue'] ? 'text-error' : 'text-primary', 'value' => $daysValue, 'label' => $pace['overdue'] ? 'Days overdue' : 'Days remaining'], ['icon' => 'calendar_view_week', 'tone' => 'text-primary', 'value' => $fmt($pace['per_week_minutes']), 'label' => 'Recommended per week'], ['icon' => 'timer', 'tone' => 'text-primary', 'value' => $fmt($pace['session_minutes']), 'label' => 'Per session · ' . $pace['sessions_per_week'] . '×/week'], ['icon' => 'pending_actions', 'tone' => 'text-secondary', 'value' => $fmt($pace['remaining_work_minutes']), 'label' => 'Learning left to do'], ]; @endphp @foreach($cards as $c)
{{ $c['icon'] }}

{{ $c['value'] }}

{{ $c['label'] }}

@endforeach
{{-- ── Progress chart: recommended vs actual ──────────────────────── --}}

Recommended vs actual progress

Where you should be by each week (guide) against where you actually are.

@php $rows = $weekly; $n = max(1, count($rows)); $W = 680; $H = 250; $pl = 36; $pr = 44; $pt = 16; $pb = 34; $iw = $W - $pl - $pr; $ih = $H - $pt - $pb; $xf = fn ($frac) => round($pl + $iw * $frac, 1); $yf = fn ($pct) => round($pt + $ih * (1 - min(100, max(0, $pct)) / 100), 1); // Recommended (target) trajectory: 0 → 100 across the plan. $recPts = [$xf(0) . ',' . $yf(0)]; foreach ($rows as $i => $r) { $recPts[] = $xf(($i + 1) / $n) . ',' . $yf($r['target']); } // Actual trajectory: only up to the current week (future weeks unknown). $actPts = [$xf(0) . ',' . $yf(0)]; $lastAct = null; foreach ($rows as $i => $r) { if (in_array($r['status'], ['completed', 'behind', 'current'], true)) { $x = $xf(($i + 1) / $n); $y = $yf($r['actual_pct']); $actPts[] = $x . ',' . $y; $lastAct = ['x' => $x, 'y' => $y, 'pct' => $r['actual_pct']]; } } $todayFrac = $pace['expected_pct'] === null ? null : $pace['expected_pct'] / 100; @endphp {{-- gridlines + y labels --}} @foreach([0, 25, 50, 75, 100] as $g) {{ $g }}% @endforeach {{-- today marker --}} @if($todayFrac !== null && ! $pace['completed']) Today @endif {{-- recommended (guide) — gold dashed --}} {{-- actual — teal solid + markers --}} @foreach($rows as $i => $r) @if(in_array($r['status'], ['completed', 'behind', 'current'], true)) @endif @endforeach {{-- x labels (thinned if many weeks) --}} @php $step = (int) ceil($n / 8); @endphp @foreach($rows as $i => $r) @if($i % $step === 0 || $i === $n - 1) {{ str_replace('Week ', 'W', $r['label']) }} @endif @endforeach {{-- direct label on the latest actual point --}} @if($lastAct) {{ $lastAct['pct'] }}% @endif {{-- legend --}}
Your progress Recommended pace
{{-- ── Snapshot ───────────────────────────────────────────────────── --}}

Where you stand

Your progress {{ $pace['progress_pct'] }}%
@if($pace['expected_pct'] !== null)
Expected by today {{ $pace['expected_pct'] }}%
@endif
Modules done
{{ $pace['completed_modules'] }} / {{ $pace['total_modules'] }}
Course length
{{ $fmt($pace['total_minutes']) }}
Started
{{ \Illuminate\Support\Carbon::parse($pace['start'])->format('j M Y') }}
Due
{{ $pace['due'] ? \Illuminate\Support\Carbon::parse($pace['due'])->format('j M Y') : 'No deadline' }}
{{-- ── Weekly / Monthly schedule ────────────────────────────────────── --}}

Your CPD schedule

Target milestones and the study time to hit them.

@php $statusMeta = [ 'completed' => ['label' => 'Completed', 'class' => 'bg-secondary-container text-on-secondary-container', 'icon' => 'task_alt'], 'behind' => ['label' => 'Behind', 'class' => 'bg-error-container text-error', 'icon' => 'error'], 'current' => ['label' => 'In Progress', 'class' => 'bg-primary/10 text-primary', 'icon' => 'timelapse'], 'upcoming' => ['label' => 'Upcoming', 'class' => 'bg-surface-container-high text-on-surface-variant', 'icon' => 'schedule'], ]; @endphp @foreach(['weekly' => $weekly, 'monthly' => $monthly] as $view => $rowsView)
@forelse($rowsView as $r) @php $sm = $statusMeta[$r['status']]; @endphp @empty @endforelse
{{ $view === 'weekly' ? 'Week' : 'Month' }} Target Recommended CPD Actual CPD Status

{{ $r['label'] }}

{{ $r['range'] }}

{{ $r['target'] }}%
{{ $fmt($r['rec_minutes']) }} {{ $r['actual_minutes'] > 0 ? $fmt($r['actual_minutes']) : '—' }} {{ $sm['icon'] }}{{ $sm['label'] }}
No schedule available.
@endforeach
@endsection