We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
whereHas
1 parent c180e70 commit 0f69f25Copy full SHA for 0f69f25
src/Cmgmyr/Messenger/Models/Thread.php
@@ -161,7 +161,7 @@ public function scopeForUserWithNewMessages($query, $userId)
161
*/
162
public function scopeBetween($query, array $participants)
163
{
164
- $query->whereHas($this->getParticipantTable(), function ($query) use ($participants) {
+ $query->whereHas('participants', function ($query) use ($participants) {
165
$query->whereIn('user_id', $participants)
166
->groupBy('thread_id')
167
->havingRaw('COUNT(thread_id)=' . count($participants));
0 commit comments