chat icon indicating copy to clipboard operation
chat copied to clipboard

$conversation = Chat::conversations()->between($participantModel1, $participantModel2); is not work

Open waiyanmyodev opened this issue 2 years ago • 2 comments

I try

$user1 = User::find(1); $user2 = User::find(2); $conversation = Chat::conversations()->between($user1, $user2); return $conversation;

in my controller

waiyanmyodev avatar Jul 30 '22 15:07 waiyanmyodev

I try

$user1 = User::find(1); $user2 = User::find(2); $conversation = Chat::conversations()->between($user1, $user2); return $conversation;

in my controller

Could you provide more information? Does the system throws an exception? Have you created a conversation before? It returns null If no conversations between participants.

I have just tested on my side and it returns Musonza\Chat\Models\Conversation as I expected Laravel 9.19, musonza/chat 6

imCaps avatar Sep 19 '22 16:09 imCaps

make sure you get conversations that are direct, and make sure direct_message column is 1.

mohamedfadol avatar Nov 14 '22 14:11 mohamedfadol