Looking at best practice for how to construct and maintain many through many relationships

Posted 2 months ago by allw

Good Afternoon,

I am a teacher constructing a site for tracking test results, but cannot get my head around the relationships.

I am envisioning a schema that has students these have many results and a test also has many results. Therefore students should have many tests through many results?

Additionally students will have many classes so there is a group_student pivot table.

How would I call principally all student results for a test where group = foobar?

Is there not an easy way to construct multiple nested relationships in laravel or is this unnecessary and I should just be retrieving each set in turn.

I have made a provisional "map" on laravelsd available:

Any help would be greatly appreciated,


Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.