@extends('admin.layouts.home') @section('title', 'Manage Courses') @php use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; @endphp @section('content')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
@forelse($courses as $course) @empty @endforelse
ID Thumbnail Title Instructor Category Price Students Rating Status Featured Actions
{{ $course->id }} @if($course->thumbnail) {{ $course->title }} @else
@endif
{{ $course->title }}
{{ Str::limit($course->description, 50) }}
{{ $course->instructor->name ?? 'N/A' }} {{ $course->category->name ?? 'N/A' }} @if($course->price == 0) Free @else ${{ number_format($course->price, 2) }} @if($course->discount_price)
${{ number_format($course->discount_price, 2) }} @endif @endif
{{ $course->total_students ?? 0 }} @if($course->average_rating) {{ number_format($course->average_rating, 1) }} @else No ratings @endif {{ $course->is_published ? 'Published' : 'Draft' }} @if($course->is_featured) Featured @else - @endif
@csrf @method('PUT')
@csrf @method('PUT')
@csrf @method('DELETE')
No courses found
{{ $courses->links('pagination::bootstrap-5') }}
@endsection