I want to create a relationship between parents (which can be Mother or Father models) and their children (Son and Daughter models). For exemple purposes, they are defined like this:
father:
id
name
mother:
id
name
son:
id
name
daughter:
id
name
I created a pivot table parent_child:
parent_child:
parent_id
child_id
parent_type
child_type
How can I create the laravel relations? Most polymorphic relations I can find in the doc only work when one of the two sides of the relation is polymorphic, not both.
Personmodel, and you'd define a relationship between each person, with the gender of thePerson(usually a column on that table) defining the type (father, son, uncle, nephew, mother, daughter, aunt, niece, etc.). The position of the people would then determine if it's a parent (above), grandparent (above a parent), child (below) grandchild (below parent), etc. Just my 2¢, but I think you have a structure problem, not a problem with polymorph.