mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 07:50:24 +08:00
fix(regression): newCollection
accepts collections
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
parent
f6c9bbb427
commit
231cee1f78
@ -47,7 +47,6 @@ class LoadMentionedByRelationship
|
||||
$loadable = null;
|
||||
|
||||
if ($data instanceof Discussion) {
|
||||
// @phpstan-ignore-next-line
|
||||
$loadable = $data->newCollection($data->posts)->filter(function ($post) {
|
||||
return $post instanceof Post;
|
||||
});
|
||||
|
@ -256,7 +256,10 @@ abstract class AbstractModel extends Eloquent
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function newCollection(array $models = [])
|
||||
/**
|
||||
* @param Collection|array $models
|
||||
*/
|
||||
public function newCollection($models = [])
|
||||
{
|
||||
return new Collection($models);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user