Skip to content

Commit

Permalink
[5.3] Add isRead and unread method to DatabaseNotification (#17243)
Browse files Browse the repository at this point in the history
* add isRead and isNotRead to DatabaseNotification

* change isNotRead to notRead

* finally change notRead to unread

* Update DatabaseNotification.php
  • Loading branch information
JellyBool authored and taylorotwell committed Jan 10, 2017
1 parent 5ed2e18 commit e480e17
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Illuminate/Notifications/DatabaseNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@ public function markAsRead()
}
}

/**
* Determine if a notification has been read.
*
* @return bool
*/
public function read()
{
return $this->read_at !== null;
}

/**
* Determine if a notification has not been read.
*
* @return bool
*/
public function unread()
{
return $this->read_at === null;
}

/**
* Create a new database notification collection instance.
*
Expand Down

0 comments on commit e480e17

Please sign in to comment.