Isn't necessary to load entire messages into collection.
Instead doing that, you can retrieve messages by latest & then take what you need (DB level), then reverse the collection to return to the view.
Also added a simple fix to return an empty collection in case that no conversation found between two users.
On "messagesWith()":
Isn't necessary to load entire messages into collection. Instead doing that, you can retrieve messages by latest & then take what you need (DB level), then reverse the collection to return to the view.
Also added a simple fix to return an empty collection in case that no conversation found between two users.