diff --git a/src/Cmgmyr/Messenger/Traits/Messagable.php b/src/Cmgmyr/Messenger/Traits/Messagable.php index b227baf..76d12ab 100644 --- a/src/Cmgmyr/Messenger/Traits/Messagable.php +++ b/src/Cmgmyr/Messenger/Traits/Messagable.php @@ -64,7 +64,7 @@ public function threadsWithNewMessages() return $this->threads() ->where(function ($q) { $q->whereNull(Models::table('participants') . '.last_read'); - $q->orWhere(Models::table('threads') . '.updated_at', '>', $this->getConnection()->raw(Models::table('participants') . '.last_read')); + $q->orWhere(Models::table('threads') . '.updated_at', '>', $this->getConnection()->raw($this->getConnection()->getTablePrefix() . Models::table('participants') . '.last_read')); })->get(); } } diff --git a/src/config/config.php b/src/config/config.php index fddd746..a1c4d72 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -11,7 +11,7 @@ 'thread_model' => Cmgmyr\Messenger\Models\Thread::class, /** - * Define custom database table names. + * Define custom database table names - without prefixes. */ 'messages_table' => null,