What have you tried so far?
There are lots of good examples in the document, you can use those as a reference for setting up your models ;)
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have this ER diagram with the three tables organizations users and roles. My question is how do I define the relationships between those, based on ER diagram I do have a pivot table which I do not understand how it works, any help would be appreciated ?

yeah, I thought the Organization roles was weird. but your ER diagram mislabels the pivot table.
so it should be role_user.
and you need a organization_user pivot table
and the answer to your question is yes.
a orginazion.user belongsToManyUsers and vice versa
Please or to participate in this conversation.