Nahid\Talk\Conversations\ConversationRepository::getMessagesAllById PHP Method

getMessagesAllById() public method

* get all conversations with soft deleted message by given conversation id
public getMessagesAllById ( $conversationId, $offset, $take )
$conversationId
$offset
$take
    public function getMessagesAllById($conversationId, $offset, $take)
    {
        return $this->with(['messages' => function ($q) use($offset, $take) {
            return $q->offset($offset)->take($take);
        }, 'userone', 'usertwo'])->find($conversationId);
    }

Usage Example

Beispiel #1
0
 /**
  * fetch all conversation with soft deleted messages by using coversation id.
  *
  * @param int $conversationId
  * @param int $offset         = 0
  * @param int $take           = 20
  *
  * @return \Nahid\Talk\Messages\Message
  */
 public function getConversationsAllById($conversationId, $offset = 0, $take = 20)
 {
     $conversations = $this->conversation->getMessagesAllById($conversationId, $offset, $take);
     return $this->makeMessageCollection($conversations);
 }