1
0
mirror of https://github.com/flarum/core.git synced 2025-08-03 15:07:53 +02:00

fix: mentions posts is not an array but collection

This commit is contained in:
Daniël Klabbers
2023-05-15 12:20:02 +02:00
parent f6c9bbb427
commit dff35c1046

View File

@@ -48,7 +48,7 @@ class LoadMentionedByRelationship
if ($data instanceof Discussion) {
// @phpstan-ignore-next-line
$loadable = $data->newCollection($data->posts)->filter(function ($post) {
$loadable = $data->newCollection((array) $data->posts)->filter(function ($post) {
return $post instanceof Post;
});
} elseif ($data instanceof Collection) {