Skip to content

Commit

Permalink
Bug(Comments): Permalinks pull all comments into memory
Browse files Browse the repository at this point in the history
Permalinked comments were pulling all comments into memory before finding the comment actually linked to, which will eventually crash the page.
  • Loading branch information
AW0005 authored Aug 25, 2024
1 parent 9c61f66 commit 84583f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/PermalinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 84583f4

Please sign in to comment.