Example #1
0
 public function index()
 {
     $sessions = ClassroomSession::whereHas('studentsSessions', function ($query) {
         $query->where('student_id', student()->id);
     })->with(['classroom.subject', 'classroom.teacher', 'studentsSessions'])->orderBy('canceled', 'asc')->orderBy('start_at', 'asc')->paginate(30);
     // return $sessions;
     return view('students::sessions.index', compact('sessions'));
 }