nahid / talk

Talk is a real-time users messaging and chatting system for Laravel.
MIT License
1.61k stars 326 forks source link

Remove extra query to determine if record exists #146

Closed nazmulpcc closed 3 years ago

nazmulpcc commented 5 years ago

The isExistsAmongTwoUsers method of ConversationRepository class first performs a query to determine if a record exists, and if it does, performs another query to fetch the conversation id. Just one query is sufficient in this case.