@extends('frontend.maintemplate.maintemplate') @section('title', 'Course Details' . ' :: AgeLess Institute') @section('content')
{{ $course->name }}
Course Program

{{ $course->subcategory->name ?? '' }}

65% Complete

done

Completed

Track ID: {{ $checkCoursePurchase->tracking_id ?? '' }}

{{ $course->name ?? '' }} Course
@foreach ($course->courseTopics as $courseTopic) @php $topicId = $courseTopic->topic->id; $isPurchasedTopic = in_array($topicId, $purchasedTopics); $statuses = $topicProgress[$topicId] ?? []; $status1 = $statuses['read_book'] ?? 'pending'; $status2 = $statuses['watch_video'] ?? 'pending'; $status3 = $statuses['mcq'] ?? 'pending'; @endphp
@csrf
{{ $loop->iteration }}. {{ $courseTopic->topic->title }}

Module {{ in_array('pending', [$status1, $status2, $status3]) ? 'In Progress' : 'Completed' }}

Step 1 Read Book @if ($status1 == 'complete') Completed @else Start @endif @if ($status1 == 'complete')
doneCompleted
@else
Pending
@endif
Step 2 Watch Video @php if (!empty($courseTopic->topic->video)) { $filename = $courseTopic->topic->video->video_upload; // Generate a UUID token for one-time access $token = \Illuminate\Support\Str::uuid()->toString(); // Define route and query params $routeParams = ['filename' => $filename]; $queryParams = ['token' => $token]; // Generate a signed route with both route and query params $secureUrl = \URL::temporarySignedRoute( 'secure.video', now()->addMinutes(120), $routeParams + $queryParams, ); } else { $filename = ''; $secureUrl = ''; } @endphp @if (!empty($filename)) {{-- Play Video --}} Play Video @endif View @if ($status2 == 'complete')
doneCompleted
@else
Pending
@endif
Step 3 MCQ Solve @if ($status3 == 'complete')
doneCompleted
@else
@endif
@endforeach
...
@endsection @section('custome_js') @endsection