From 64b9fadf1575b527b88acbbd65e63e1b7ab0dcb8 Mon Sep 17 00:00:00 2001 From: Wes Hooper Date: Fri, 18 Feb 2022 11:09:16 +0000 Subject: [PATCH] Use latest() within notifications() --- src/Illuminate/Notifications/HasDatabaseNotifications.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Notifications/HasDatabaseNotifications.php b/src/Illuminate/Notifications/HasDatabaseNotifications.php index 5f999da9a34d..162d16cb9101 100644 --- a/src/Illuminate/Notifications/HasDatabaseNotifications.php +++ b/src/Illuminate/Notifications/HasDatabaseNotifications.php @@ -11,7 +11,7 @@ trait HasDatabaseNotifications */ public function notifications() { - return $this->morphMany(DatabaseNotification::class, 'notifiable')->orderBy('created_at', 'desc'); + return $this->morphMany(DatabaseNotification::class, 'notifiable')->latest(); } /**