Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Rename Model::$collection to $collectionClass #52186

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading