{{ $currentLesson->title }}
@if(isset($lessonProgress[$currentLesson->id]) && $lessonProgress[$currentLesson->id]->is_completed)
@else
@endif
{!! nl2br(e($currentLesson->content)) !!}
@if($currentLesson->attachment)
Downloadable Resources
Download Attachment
@php
$prevLesson = null;
$nextLesson = null;
$foundCurrent = false;
$lessonIndex = 0;
foreach($course->sections as $section) {
foreach($section->lessons as $lesson) {
if($foundCurrent) {
$nextLesson = $lesson;
break 2;
}
if($lesson->id == $currentLesson->id) {
$foundCurrent = true;
} else {
$prevLesson = $lesson;
}
$lessonIndex++;
}
if($foundCurrent && $nextLesson) {
break;
}
}
@endphp
@if($prevLesson)
Previous Lesson
@else
@endif
@if($nextLesson)
Next Lesson
@else
@endif