forked from munafio/chatify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use the markAsRead method directly on a collection
- Loading branch information
1 parent
50061ed
commit 5ae7093
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Chatify; | ||
|
||
use Illuminate\Database\Eloquent\Collection; | ||
|
||
class MessageCollection extends Collection | ||
{ | ||
/** | ||
* Mark all notifications as read. | ||
* | ||
* @return void | ||
*/ | ||
public function markAsRead() | ||
{ | ||
$this->each->markAsRead(); | ||
} | ||
|
||
/** | ||
* Mark all notifications as unread. | ||
* | ||
* @return void | ||
*/ | ||
public function markAsUnread() | ||
{ | ||
$this->each->markAsUnread(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters