@mstnorris You can have multiple relations to the same model.
You could maybe have a Student model and a Teacher model, both of which extend your User model. Those could then have relevant methods inside:
class Student extends User
{
public function modulesEnrolledOn()
{
return $this->belongsToMany('Module', 'course_student', 'student_id', 'id');
}
}
class Teacher extends User
{
public function modulesTeaching()
{
return $this->belongsToMany('Module', 'course_teacher', 'teacher_id', 'id');
}
}
Alternatively, you could put both methods in your User class in case you have some bright, young student who is both taking courses, as well as teaching some!