Part 8 - Course detail

  • Detail page for the selected course
    • Name of course
    • Description of course
    • List of students enrolled in course
      • Semester 1/2 in parentheses
  • Result:

Course 1 detail students

Course 3 detail students

TIP

  • Besides the course name and description, we want to display the students enrolled for this course. Therefore we need to include the associative table and student table in our query.
    • We do navigate through tables via the . (dot) notation: with('studentcourses')->with('studentcourses.student')
    • The resulting JSON looks like this:
      course json result
Last Updated: 11/11/2020, 10:16:30 PM