public function between($userOne, $userTwo)
    {
        $conversation1 = $this->conversation->userConversations($userOne)->toArray();
        $conversation2 = $this->conversation->userConversations($userTwo)->toArray();

        $common_conversations = $this->getConversationsInCommon($conversation1, $conversation2);

        if (!$common_conversations) {
            return;
        }

        return $this->conversation->findOrFail($common_conversations[0]);
    }
public function between($userOne, $userTwo)
    {
        $conversation1 = $this->conversation->userConversations($userOne)->toArray();
        $conversation2 = $this->conversation->userConversations($userTwo)->toArray();

        $common_conversations = $this->getConversationsInCommon($conversation1, $conversation2);

        if (!$common_conversations) {
            return;
        }

        return $this->conversation->findOrFail($common_conversations[0]);
    }
public function between ( $ userOne , $ userTwo ) { $ conversation1 = $ this -> conversation -> userConversations ( $ userOne ) -> toArray ( ) ; $ conversation2 = $ this -> conversation -> userConversations ( $ userTwo ) -> toArray ( ) ; $ common_conversations = $ this -> getConversationsInCommon ( $ conversation1 , $ conversation2 ) ; if ( ! $ common_conversations ) { return ; } return $ this -> conversation -> findOrFail ( $ common_conversations [ 0 ] ) ; }
Get Private Conversation between two users.

@param int | User $userOne
@param int | User $userTwo

@return Conversation
Get Private Conversation between two users .