From dff35c10465e359881a073dc257f4cc1f10e277d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Klabbers?= Date: Mon, 15 May 2023 12:20:02 +0200 Subject: [PATCH] fix: mentions posts is not an array but collection --- extensions/mentions/src/Api/LoadMentionedByRelationship.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/mentions/src/Api/LoadMentionedByRelationship.php b/extensions/mentions/src/Api/LoadMentionedByRelationship.php index e6ba9f4fb..4d609dbca 100644 --- a/extensions/mentions/src/Api/LoadMentionedByRelationship.php +++ b/extensions/mentions/src/Api/LoadMentionedByRelationship.php @@ -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) {