diff --git a/src/Discussion/Discussion.php b/src/Discussion/Discussion.php index 9e45a8783..c80404e3e 100644 --- a/src/Discussion/Discussion.php +++ b/src/Discussion/Discussion.php @@ -108,7 +108,7 @@ class Discussion extends AbstractModel // PostWasDeleted event for each post. $posts = $discussion->posts()->allTypes(); - foreach ($posts->get() as $post) { + foreach ($posts->cursor() as $post) { $discussion->raise(new PostDeleted($post)); } diff --git a/src/User/User.php b/src/User/User.php index 7c02c882d..f5f7954c8 100644 --- a/src/User/User.php +++ b/src/User/User.php @@ -134,7 +134,7 @@ class User extends AbstractModel // PostWasDeleted event for each post. $posts = $user->posts()->allTypes(); - foreach ($posts->get() as $post) { + foreach ($posts->cursor() as $post) { $user->raise(new PostDeleted($post)); }