Skip to content

Commit

Permalink
Rename Model::$collection to $collectionClass (#52186)
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN authored Jul 18, 2024
1 parent c49e901 commit 7d26b7e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/HasCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ trait HasCollection
*/
public function newCollection(array $models = [])
{
return new static::$collection($models);
return new static::$collectionClass($models);
}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Notifications/DatabaseNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion types/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Post extends Model
/** @use HasCollection<Posts<array-key, static>> */
use HasCollection;

protected static string $collection = Posts::class;
protected static string $collectionClass = Posts::class;
}

/**
Expand Down

0 comments on commit 7d26b7e

Please sign in to comment.