You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You will need to actually add a second user and pass the Request object to retrieve it, that's what you are missing
in your $conversation variable, try to do User::find($request->withUserId)); and then through your form pass a user id parameter, below is the refactored code.
public function getConversationWithTwoUsers(Request $request, $withUserId)
{
$user = Auth::user();
$conversation = Chat::conversations()->between($user, User::find($request->withUserId));
dd($conversation);
}
Hi sir
I have tried to get the conversations message with two users(sender & receiver) but it is return null ,please see my function and tell
public function getConversationWithTwoUsers(Request $request, $withUserId)
{
$user = Auth::user();
$conversation = Chat::conversations()->between($user, User::find($withUserId));
dd($conversation);
}
return null
Thank you
The text was updated successfully, but these errors were encountered: