I'd say you'd need to break it down.
How many companies can a user belong to?
Is a task assigned to 1 company or to many?
i.e. find the relationships between each of the entities individually and build the relationships from there.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have followings entities:
Task ( task_id - PK )
Company (company_id - PK)
User (user_id - PK)
Company-Task-User( id - PK, task_id - FK, company_id - FK, user_id - FK, status - boolean, end_date - Date )
how would i model the eloquent relationships?
Please or to participate in this conversation.