diff --git a/src/Illuminate/Notifications/DatabaseNotificationCollection.php b/src/Illuminate/Notifications/DatabaseNotificationCollection.php index 05924ec67220..5bac0272dd7b 100644 --- a/src/Illuminate/Notifications/DatabaseNotificationCollection.php +++ b/src/Illuminate/Notifications/DatabaseNotificationCollection.php @@ -4,6 +4,12 @@ use Illuminate\Database\Eloquent\Collection; +/** + * @template TKey of array-key + * @template TModel of DatabaseNotification + * + * @extends \Illuminate\Database\Eloquent\Collection + */ class DatabaseNotificationCollection extends Collection { /** diff --git a/types/Notifications/DatabaseNotificationCollection.php b/types/Notifications/DatabaseNotificationCollection.php new file mode 100644 index 000000000000..f2ab9453484d --- /dev/null +++ b/types/Notifications/DatabaseNotificationCollection.php @@ -0,0 +1,25 @@ + + */ +class CustomNotificationCollection extends DatabaseNotificationCollection +{ + // +} + +$databaseNotificationsCollection = DatabaseNotification::all(); +assertType('Illuminate\Database\Eloquent\Collection', $databaseNotificationsCollection); + +$customNotificationsCollection = CustomNotification::all(); +assertType('Illuminate\Database\Eloquent\Collection', $customNotificationsCollection);