You dont need to set up a relationship if you are using roles and permission... its a different topic what you are explaining , what you are saying is multi auth... multiple model for student and teacher....
its possible to that relationship student has many teachers and teach belongs to a student
then you need to set up a exam model teacher can create many exams and student can have many exams exams can have many teacher and student a many to many relationship triple pivot
out of the box laravel dont support that type of pivot
there is a package triple pivot
exam_teacher_student
there is a package implements eloquent for triple pivot...
of course if you do intend to use roles and permission and avoid triple pivot to avoid headaches...
you need silber bouncer package i use it... it has a polymorphic model that you can use for many model ....
from there you can do teacher has many exams student has many exams
and leave exams table alone....
and leave the roles permission give authorization for action in your controller
to view the exams create exams and edit....