Skip to content

Commit 3b4a925

Browse files
authored
fix trending articles shows current article (#791)
1 parent 18adff7 commit 3b4a925

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app/Http/Controllers/Articles/ArticlesController.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,11 @@ public function show(Article $article)
7979
404,
8080
);
8181

82-
$trendingArticles = Cache::remember('trendingArticles', now()->addHour(), function () use ($article) {
83-
return Article::published()
84-
->trending()
85-
->whereKeyNot($article->id)
86-
->limit(3)
87-
->get();
88-
});
82+
$trendingArticles = Article::published()
83+
->trending()
84+
->whereKeyNot($article->id)
85+
->limit(3)
86+
->get();
8987

9088
return view('articles.show', [
9189
'article' => $article,

0 commit comments

Comments
 (0)