mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-22 18:20:31 -05:00
(Update) HomeController.php
Add 'new_news' flag for articles less than 3 days old
This commit is contained in:
@@ -51,6 +51,9 @@ class HomeController extends Controller
|
||||
|
||||
// Latest Articles/News Block
|
||||
$articles = cache()->remember('latest_article', $expiresAt, fn () => Article::latest()->take(1)->get());
|
||||
foreach ($articles as $article) {
|
||||
$article->new_news=($user->updated_at->subDays(3)->getTimestamp() < $article->created_at->getTimestamp()) ? 1 : 0 ;
|
||||
}
|
||||
|
||||
// Latest Torrents Block
|
||||
$personal_freeleech = PersonalFreeleech::where('user_id', '=', $user->id)->first();
|
||||
|
||||
Reference in New Issue
Block a user