From 71e52bd63e1a100d03f5edbb4258a4908befd38a Mon Sep 17 00:00:00 2001 From: JellyBool Date: Tue, 10 Jan 2017 23:50:41 +0800 Subject: [PATCH 1/4] add isRead and isNotRead to DatabaseNotification --- .../Notifications/DatabaseNotification.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Illuminate/Notifications/DatabaseNotification.php b/src/Illuminate/Notifications/DatabaseNotification.php index a8e6ec12beb2..7bd7df71d5a1 100644 --- a/src/Illuminate/Notifications/DatabaseNotification.php +++ b/src/Illuminate/Notifications/DatabaseNotification.php @@ -57,6 +57,26 @@ public function markAsRead() } } + /** + * Determine a notification is read. + * + * @return bool + */ + public function isRead() + { + return $this->read_at !== null; + } + + /** + * Determine a notification is not read yet. + * + * @return bool + */ + public function isNotRead() + { + return $this->read_at === null; + } + /** * Create a new database notification collection instance. * From 16257820c28dfc0e5ce23d4855151f3c9df35a5c Mon Sep 17 00:00:00 2001 From: JellyBool Date: Wed, 11 Jan 2017 00:19:32 +0800 Subject: [PATCH 2/4] change isNotRead to notRead --- src/Illuminate/Notifications/DatabaseNotification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Notifications/DatabaseNotification.php b/src/Illuminate/Notifications/DatabaseNotification.php index 7bd7df71d5a1..0d881220fa54 100644 --- a/src/Illuminate/Notifications/DatabaseNotification.php +++ b/src/Illuminate/Notifications/DatabaseNotification.php @@ -72,7 +72,7 @@ public function isRead() * * @return bool */ - public function isNotRead() + public function notRead() { return $this->read_at === null; } From 35d9d38be636b6e5ec30a6078b4afa6328cdaa57 Mon Sep 17 00:00:00 2001 From: JellyBool Date: Wed, 11 Jan 2017 01:38:11 +0800 Subject: [PATCH 3/4] finally change notRead to unread --- src/Illuminate/Notifications/DatabaseNotification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Notifications/DatabaseNotification.php b/src/Illuminate/Notifications/DatabaseNotification.php index 0d881220fa54..909e4134a438 100644 --- a/src/Illuminate/Notifications/DatabaseNotification.php +++ b/src/Illuminate/Notifications/DatabaseNotification.php @@ -72,7 +72,7 @@ public function isRead() * * @return bool */ - public function notRead() + public function unread() { return $this->read_at === null; } From f9b10d3fbba134351a414e3a3c3cb16123be8d85 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 10 Jan 2017 13:02:31 -0600 Subject: [PATCH 4/4] Update DatabaseNotification.php --- src/Illuminate/Notifications/DatabaseNotification.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Notifications/DatabaseNotification.php b/src/Illuminate/Notifications/DatabaseNotification.php index 909e4134a438..f50006e97173 100644 --- a/src/Illuminate/Notifications/DatabaseNotification.php +++ b/src/Illuminate/Notifications/DatabaseNotification.php @@ -58,17 +58,17 @@ public function markAsRead() } /** - * Determine a notification is read. + * Determine if a notification has been read. * * @return bool */ - public function isRead() + public function read() { return $this->read_at !== null; } /** - * Determine a notification is not read yet. + * Determine if a notification has not been read. * * @return bool */