From 84583f4a1cf35e2fbe93d9493a9272d0bf741356 Mon Sep 17 00:00:00 2001 From: moif <104588768+AW0005@users.noreply.github.com> Date: Sun, 25 Aug 2024 13:17:24 -0400 Subject: [PATCH] Bug(Comments): Permalinks pull all comments into memory Permalinked comments were pulling all comments into memory before finding the comment actually linked to, which will eventually crash the page. --- app/Http/Controllers/PermalinkController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/PermalinkController.php b/app/Http/Controllers/PermalinkController.php index 02dfb9de79..f27c7bc36a 100644 --- a/app/Http/Controllers/PermalinkController.php +++ b/app/Http/Controllers/PermalinkController.php @@ -16,7 +16,7 @@ class PermalinkController extends Controller { * @return \Illuminate\Contracts\Support\Renderable */ public function getComment($id) { - $comments = Comment::withTrashed()->get(); + $comments = Comment::withTrashed(); //$comments = $comments->sortByDesc('created_at'); $comment = $comments->find($id);