Initial commit
This commit is contained in:
commit
c909d539bc
7178 files changed
+756624
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
//namespace App\Http\Controllers\Student;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Course;
|
||||
use App\Models\Lesson;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
// Replace this with your real enrolments when ready:
|
||||
$courses = Course::with('subject', 'level')->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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user