Asking this question means you don't know how work (laravel / eloquent) relation. The best way is to begin to code some examples by yourself and then if you get real pb ask for help.
https://laravel.com/docs/9.x/eloquent-relationships#introduction
I have a user model and these users have some sorts of relationships together.
Example: John is Jack and Jill's father.
Jack and Jill are siblings.
Jack is the friend of Jacob and Joshua.
I want this to be neat and the solution to make a pivot like (user_one, user_two, relation_one, relation_two) doesn't seem clean to me and becomes repetitive.
How can I implement this kind of relationship altogether? It's a mixture of family relationships and friendships so I'm confused what is the BEST practice for this?
Note: Users can not make relations by themselves. Admin creates all of the relations. It's a report website and I want to show related users (father, siblings, friends ) when visiting a user info page.
Its not like a tree that you can traverse because friends are much more free flowing. EG Jacob might be friends with BOTH Jack and John
Seems to me that you need a pivot table with the relationships and a column that describes the nature of the relationship
1 2 Father
2 1 Daughter
6 1 Friend
6 4 Sibling
4 6 Sibling
2 3 Partner
etc
Please or to participate in this conversation.