nahid / talk

Talk is a real-time users messaging and chatting system for Laravel.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting latest messages from db

shenjiayu opened this issue · comments

Currently, all getConversations(XX), getMessages(xx) functions are retrieving messages from the earliest to the latest with the help of $offset and $take.
But In most cases, users need to see latest messages first and then scroll up to see old messages.
Would it be better to do things like $query->latest()->offset($offset)->take($take)?