laravel-messenger: ErrorException in Builder.php line 2450 (for unread-count.blade.php)

I got an error with the newThreadsCount() method in unread-count.blade.php. Working in Laravel 5.3 – full error below:

Call to undefined method Illuminate\Database\Query\Builder::newThreadsCount() (View: /var/www/html/test-site/resources/views/messenger/unread-count.blade.php)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 29 (13 by maintainers)

Most upvoted comments

@cmgmyr @Xationch @a-komarev So after a lot of research, all I had to do was run php artisan optimize! I uninstalled a dependency I wasn’t using and it ran the command and lone behold everything worked like a charm!

Thanks for the update @rtd62!

@rtd62 Thanks for sharing the solution!

hrm. Ok keep us posted and we’ll do our best to help out 🙂

I tried removing other traits – looks like I’ll have to try this on a fresh install. Maybe I missed a step. Thank you for all the help! I’ll report back when I find the cause of the issue.

Why your User class is lowercase class user extends Model ?

And for your info you can simplify your use:

use Billable,
    Searchable,
    UserTrait,
    RemindableTrait,
    // NotifableTrait,
    Messagable;