Skip to content

Commit 097a57e

Browse files
committed
add db prefix to raw query
1 parent 16d99c7 commit 097a57e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Cmgmyr/Messenger/Traits/Messagable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function threadsWithNewMessages()
6464
return $this->threads()
6565
->where(function ($q) {
6666
$q->whereNull(Models::table('participants') . '.last_read');
67-
$q->orWhere(Models::table('threads') . '.updated_at', '>', $this->getConnection()->raw(Models::table('participants') . '.last_read'));
67+
$q->orWhere(Models::table('threads') . '.updated_at', '>', $this->getConnection()->raw($this->getConnection()->getTablePrefix() . Models::table('participants') . '.last_read'));
6868
})->get();
6969
}
7070
}

src/config/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
'thread_model' => Cmgmyr\Messenger\Models\Thread::class,
1212

1313
/**
14-
* Define custom database table names.
14+
* Define custom database table names - without prefixes.
1515
*/
1616
'messages_table' => null,
1717

0 commit comments

Comments
 (0)