I am trying to create a simple private conversation between two users. I've tried following some examples but all i can find is for multiple users in multiple conversations and more complex versions. My endgoal is for simply be able to do $user->conversations->messages
to get all my conversations and their messages that has been sent between two users.
I currently have 3 models for this.
User Model
Conversation Model
PrivateMessages Model
My tables currently look like this but i think i need to do some changes to them also.
users:
id
name
conversations:
id
private_messages:
id
sent_by
sent_to
body
read_at
conversation_id
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire