From 7d26b7ee454a0ccc339db92a641487f668b44331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Thu, 18 Jul 2024 22:45:25 +0200 Subject: [PATCH] Rename Model::$collection to $collectionClass (#52186) --- src/Illuminate/Database/Eloquent/HasCollection.php | 2 +- src/Illuminate/Database/Eloquent/Model.php | 2 +- src/Illuminate/Notifications/DatabaseNotification.php | 2 +- types/Database/Eloquent/Model.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/HasCollection.php b/src/Illuminate/Database/Eloquent/HasCollection.php index 6bdacb4bd380..e676bb79ae7c 100644 --- a/src/Illuminate/Database/Eloquent/HasCollection.php +++ b/src/Illuminate/Database/Eloquent/HasCollection.php @@ -15,6 +15,6 @@ trait HasCollection */ public function newCollection(array $models = []) { - return new static::$collection($models); + return new static::$collectionClass($models); } } diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index b4b5a2d66c5f..703b6d4eb086 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -225,7 +225,7 @@ abstract class Model implements Arrayable, ArrayAccess, CanBeEscapedWhenCastToSt * * @var class-string<\Illuminate\Database\Eloquent\Collection<*, *>> */ - protected static string $collection = Collection::class; + protected static string $collectionClass = Collection::class; /** * The name of the "created at" column. diff --git a/src/Illuminate/Notifications/DatabaseNotification.php b/src/Illuminate/Notifications/DatabaseNotification.php index 6c54197c579d..19cfcfe00528 100644 --- a/src/Illuminate/Notifications/DatabaseNotification.php +++ b/src/Illuminate/Notifications/DatabaseNotification.php @@ -52,7 +52,7 @@ class DatabaseNotification extends Model /** * The type of collection that should be used for the model. */ - protected static string $collection = DatabaseNotificationCollection::class; + protected static string $collectionClass = DatabaseNotificationCollection::class; /** * Get the notifiable entity that the notification belongs to. diff --git a/types/Database/Eloquent/Model.php b/types/Database/Eloquent/Model.php index 15c34c74cdc0..9bf2a8c7c531 100644 --- a/types/Database/Eloquent/Model.php +++ b/types/Database/Eloquent/Model.php @@ -46,7 +46,7 @@ class Post extends Model /** @use HasCollection> */ use HasCollection; - protected static string $collection = Posts::class; + protected static string $collectionClass = Posts::class; } /**