allw
269
10
Eloquent

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

Posted 8 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:

http://www.laravelsd.com/share/zU8Xrs

Any help would be greatly appreciated,

Thanks!

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

Reply to

Use Markdown with GitHub-flavored code blocks.