@extends('admin.layouts.app') @section('title', 'Courses') @section('page-title', 'Courses') @section('content') {{-- Header --}}

Courses

Manage all training programs shown on the website

Add New Course
{{-- Stats row --}}
@php $total = \App\Models\Course::count(); $active = \App\Models\Course::where('is_active', true)->count(); $featured = \App\Models\Course::where('is_featured', true)->count(); @endphp

Total

{{ $total }}

Active

{{ $active }}

Featured

{{ $featured }}

{{-- Search bar --}}
@if(request('search') || request('status')) Clear @endif
{{-- Table --}} @if($courses->isEmpty())

No courses found

Get started by adding your first course.

Add First Course
@else
@foreach($courses as $course) {{-- Sort order --}} {{-- Course info --}} {{-- Duration --}} {{-- Starting date --}} {{-- Status badges --}} {{-- Actions --}} @endforeach
# Course Duration Starting Date Status Actions
{{ $course->sort_order ?: $loop->iteration }}
{{-- Thumbnail --}} @if($course->featured_image && file_exists(public_path('uploads/courses/'.$course->featured_image))) {{ $course->title }} @else
@endif

{{ $course->title }}

/courses/{{ $course->slug }}

@if($course->certification) {{ $course->certification }} @endif
{{ $course->duration ?? '—' }} {{ $course->formatted_starting_date }}
@if($course->is_active) Active @else Inactive @endif @if($course->is_featured) Featured @endif
@csrf @method('DELETE')
@if($courses->hasPages())
{{ $courses->links() }}
@endif
@endif @endsection