get(); $otherCourses = Course::with('subject', 'level') ->whereNotIn('id', $courses->pluck('id')) ->get(); $lastLesson = Lesson::with([ 'chapter', 'lessonSection.module.course.subject', 'lessonSection.module.course.level', ])->orderBy('id')->first(); return view('student.dashboard', [ 'courses' => $courses, 'otherCourses' => $otherCourses, 'lastLesson' => $lastLesson, ]); } }