i'm trying to achieve a private messaging system in Laravel but i'm stuck by checking if a conversation exist.
I have 3 Tables:
conversations
- id
users
- id
- name
- etc
conversation_user (pivot)
- user_id
- conversation id
My model Conversation belongsToMany Users and User belongsToMany Conversations.
Adding a conversation and attaching the users to the pivot table is working fine but i don't find a clean way to check if a conversation between 2 users exist.
I appreciate any help.
Ben