Skip to content

Commit

Permalink
Add database notification relation readNotifications()
Browse files Browse the repository at this point in the history
  • Loading branch information
shadoWalker89 committed Oct 29, 2016
1 parent 172f9d6 commit e106fa1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Illuminate/Notifications/HasDatabaseNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,14 @@ public function unreadNotifications()
->whereNull('read_at')
->orderBy('created_at', 'desc');
}

/**
* Get the entity's read notifications.
*/
public function readNotifications()
{
return $this->morphMany(DatabaseNotification::class, 'notifiable')
->whereNotNull('read_at')
->orderBy('created_at', 'desc');
}
}

0 comments on commit e106fa1

Please sign in to comment.