@extends('dashboard.layouts.app') @section('title', __('Courses')) @section('page_heading', __('Courses')) @section('breadcrumb') @endsection @section('content')

{{ __('Courses') }}

@if($courses->isEmpty())
{{ __('No courses found.') }}
@else
@foreach ($courses as $course) {{-- Format the date --}} {{-- Check if end_date exists --}} @endforeach
{{ __('ID') }} {{ __('Category') }} {{ __('Track') }} {{ __('Level') }} {{ __('Type') }} {{ __('Teacher') }} {{ __('Sessions/Week') }} {{ __('Start Date') }} {{ __('End Date') }} {{ __('Status') }} {{ __('Actions') }}
{{ $course->id }} {{ $course->trackCategory->name }} {{ $course->track->name }} {{ $course->trackLevel->name }} {{ $course->trackType->name }} {{ $course->teacher->name ?? 'N/A' }} {{ $course->sessions_per_week }} {{ $course->start_date->format('Y-m-d') }}{{ $course->end_date ? $course->end_date->format('Y-m-d') : 'N/A' }} @switch($course->status) @case('scheduled') {{ __('Scheduled') }} @break @case('in_progress') {{ __('In Progress') }} @break @case('completed') {{ __('Completed') }} @break @case('cancelled') {{ __('Cancelled') }} @break @default {{ $course->status }} @endswitch {{ __('View') }} {{ __('Edit') }}
@csrf @method('DELETE')
{{ $courses->links() }} @endif
@endsection @push('scripts') {{-- Add any custom scripts for this page here, if needed. --}} @endpush