Skip to content

Commit 0f69f25

Browse files
antonkomarevcmgmyr
authored andcommitted
Method whereHas should accept relation but not a table name.
1 parent c180e70 commit 0f69f25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Cmgmyr/Messenger/Models/Thread.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function scopeForUserWithNewMessages($query, $userId)
161161
*/
162162
public function scopeBetween($query, array $participants)
163163
{
164-
$query->whereHas($this->getParticipantTable(), function ($query) use ($participants) {
164+
$query->whereHas('participants', function ($query) use ($participants) {
165165
$query->whereIn('user_id', $participants)
166166
->groupBy('thread_id')
167167
->havingRaw('COUNT(thread_id)=' . count($participants));

0 commit comments

Comments
 (0)