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

asadhshujau's avatar

3 table relationships

there is a guardian table, student table, family table and a familymember table

each family can have guardians and students hence the family member table

how will the migrations and eloquent relations look like?

0 likes
1 reply
tisuchi's avatar

A rough idea can be-

  • A Student belongs to a Guardian
  • A guardian has many students
  • A family belongs to a Guardian
  • A guardian has many families
  • A family has many members

Now you need to write your relationships code like that way.

Please or to participate in this conversation.