Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Hal9000's avatar

intermediary relationship

I am designing my ER diagram and came to a halt when i tried to associate the teacher table with Course_Subject intermediary table? first of all, is it possible to make an assocciation with an intermediary table ?

i need to answer this kind of query, for example: get all teachers whose course(courses are equivalent to grades in this case) is fourth grade and that tutors on subject math.

https://s24.postimg.org/pz48gd8r9/my_ERDdiagram.jpg

i was thinking of creating a new entity called Class and associate the 3 tables like this:

class(course_id, subject_id, teacher_id , date)

If the first case is possible, how do i make the association in the model with Laravel?

thanks in advance

0 likes
0 replies

Please or to participate in this conversation.