cmgmyr / laravel-messenger

Simple user messaging package for Laravel
MIT License
2.46k stars 517 forks source link

Count of new messages #80

Closed mukhamadievrustem closed 8 years ago

mukhamadievrustem commented 9 years ago

How can I get the count of new messages in thread?

DxCat commented 9 years ago

It's on the example file provided.here https://github.com/cmgmyr/laravel-messenger/blob/master/src/Cmgmyr/Messenger/examples/views/messenger/unread-count.blade.php

Auth::user()->newMessagesCount();
mukhamadievrustem commented 9 years ago

newMessagesCount() returns the number of threads with new messages, but not count of new messages in threads

danbalarin commented 8 years ago

bump, I would appreciate it, too

antonkomarev commented 8 years ago

+1 for this feature

cmgmyr commented 8 years ago

This is now in master, please let me know if there are any bugs that come up. I'm going to make some adjustments as well as maybe change the API a bit. Once everything is set I'll tag and release it.

trinhsong commented 8 years ago

How can i get a slidedown of unread threads in navbar? Thank you!

cmgmyr commented 8 years ago

The implementation in your design will be up to you, but now you can use the userUnreadMessages($user_id) or userUnreadMessagesCount($user_id) methods on the Thread model

antonkomarev commented 8 years ago

@cmgmyr see #120 please. I've found couple of bugs related to this feature and resolved them.

cmgmyr commented 8 years ago

These changes have been tagged 2.11 along with one small API change. Please see the release notes for more info. Going to close this for now. If anyone has any issues with the update, please submit a new ticket. Thank you, everyone, for your input and work on this!