Update HomeController.php

This commit is contained in:
innocente205
2020-04-30 16:05:42 +07:00
committed by GitHub
parent bb7fe1a334
commit 0249b8db7a
+1 -1
View File
@@ -51,7 +51,7 @@ class HomeController extends Controller
// Latest Articles/News Block
$articles = cache()->remember('latest_article', $expiresAt, fn () => Article::latest()->take(1)->get());
foreach ($articles as $article) {
foreach ($articles as $article) {
$article->newNews = ($user->updated_at->subDays(3)->getTimestamp() < $article->created_at->getTimestamp()) ? 1 : 0 ;
}