@melloman , what I do in situations like this is define the inverse of the relationship as well (eg. students have teachers, but teachers also have students).
So, for the student model, you'd have a method something like this one:
public function teachers()
{
return $this->belongsToMany('App\Teacher', 'student_teacher');
}
And for the teacher model, you'd have a method something like this one:
public function students()
{
return $this->belongsToMany('App\Student', 'student_teacher');
}
This many to many relationship requires that you have an additional table (here I explicitly name it 'student_teacher'). The table would have at least two columns: student_id (unsigned integer), and teacher_id (also unsigned integer). Once you have this, you can make lookup calls back and forth like you are describing. Eg:
$student = App\Student::first();
$studentsTeachers = $student->teachers()->get();
$teacher = App\Teacher::first();
$teachersStudents = $teacher->students()->get();
This is also nice as it allows you to attach and detach multiple relations with a single call, the sync() method (only available on models that have the 'belongsToMany' relationship, as far as I understand; refer to documentations if that becomes a question).
Hope that helps somewhat.