Skip to content

Commit 7d26b7e

Browse files
authored
Rename Model::$collection to $collectionClass (#52186)
1 parent c49e901 commit 7d26b7e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Illuminate/Database/Eloquent/HasCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ trait HasCollection
1515
*/
1616
public function newCollection(array $models = [])
1717
{
18-
return new static::$collection($models);
18+
return new static::$collectionClass($models);
1919
}
2020
}

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ abstract class Model implements Arrayable, ArrayAccess, CanBeEscapedWhenCastToSt
225225
*
226226
* @var class-string<\Illuminate\Database\Eloquent\Collection<*, *>>
227227
*/
228-
protected static string $collection = Collection::class;
228+
protected static string $collectionClass = Collection::class;
229229

230230
/**
231231
* The name of the "created at" column.

src/Illuminate/Notifications/DatabaseNotification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class DatabaseNotification extends Model
5252
/**
5353
* The type of collection that should be used for the model.
5454
*/
55-
protected static string $collection = DatabaseNotificationCollection::class;
55+
protected static string $collectionClass = DatabaseNotificationCollection::class;
5656

5757
/**
5858
* Get the notifiable entity that the notification belongs to.

types/Database/Eloquent/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Post extends Model
4646
/** @use HasCollection<Posts<array-key, static>> */
4747
use HasCollection;
4848

49-
protected static string $collection = Posts::class;
49+
protected static string $collectionClass = Posts::class;
5050
}
5151

5252
/**

0 commit comments

Comments
 (0)