{{-- My Courses — full enrolled-course listing. From EmployeeCourseController@index: $courses = Collection each with ->pivot->status (live) and ->pivot->progress_percent $stats = ['total','completed','in_progress','overdue'] --}} @extends('layouts.app') @section('title', 'My Courses') @section('content') @include('employee._flash') {{-- Summary tiles --}}
@php $tiles = [ ['label' => 'Assigned', 'value' => $stats['total'], 'icon' => 'school', 'class' => 'text-primary'], ['label' => 'Completed', 'value' => $stats['completed'], 'icon' => 'task_alt', 'class' => 'text-on-secondary-container'], ['label' => 'In Progress', 'value' => $stats['in_progress'], 'icon' => 'timelapse', 'class' => 'text-secondary'], ['label' => 'Overdue', 'value' => $stats['overdue'], 'icon' => 'warning', 'class' => 'text-error'], ]; @endphp @foreach($tiles as $tile)
{{ $tile['icon'] }}

{{ $tile['value'] }}

{{ $tile['label'] }}

@endforeach
{{-- Filter tabs --}}
@php $filters = [ 'all' => 'All', 'mandatory' => 'Mandatory', 'service_specific' => 'Service Specific', 'overdue' => 'Overdue', 'completed' => 'Completed', ]; @endphp @foreach($filters as $key => $label) @endforeach
{{-- Course grid --}} @if($courses->isEmpty())
school

No courses assigned yet

When your manager assigns training, it'll appear here.

@else
@foreach($courses as $course) @php $status = $course->pivot->status ?? 'not_started'; $progress = $course->pivot->progress_percent ?? 0; $badge = match($status) { 'completed' => ['label' => 'Completed', 'class' => 'bg-secondary-container text-on-secondary-container'], 'overdue' => ['label' => 'Overdue', 'class' => 'bg-error-container text-error'], 'in_progress' => ['label' => $progress . '% done', 'class' => 'bg-primary/10 text-primary'], default => ['label' => 'Not started', 'class' => 'bg-surface-container-high text-on-surface-variant'], }; @endphp
@if($course->thumbnail) {{ $course->title }} @else
school
@endif
{{ $course->duration_minutes }} min
@if($course->category === 'service_specific')

Service Specific

@else

Mandatory

@endif

{{ $course->title }}

{{ $badge['label'] }}
@endforeach
@endif @endsection