Update (kernel)
This commit is contained in:
@@ -18,11 +18,11 @@ public function home(Request $request)
|
||||
// $query->whereNotIn('id', [$featured_post?->id]);
|
||||
// })->where('status', 'publish')->orderBy('published_at', 'desc')->limit(5)->get();
|
||||
|
||||
$featured_posts = Post::where('status', 'publish')->where('published_at', '<=', now())->orderBy('published_at', 'desc')->limit(6)->get();
|
||||
$featured_posts = Post::where('status', 'publish')->where('published_at', '<=', now())->orderBy('published_at', 'desc')->limit(3)->get();
|
||||
|
||||
$latest_posts = Post::where(function ($query) use ($featured_posts) {
|
||||
$query->whereNotIn('id', $featured_posts->pluck('id')->toArray());
|
||||
})->where('status', 'publish')->where('published_at', '<=', now())->orderBy('published_at', 'desc')->limit(6)->get();
|
||||
})->where('status', 'publish')->where('published_at', '<=', now())->orderBy('published_at', 'desc')->limit(9)->get();
|
||||
|
||||
return response(view('front.welcome', compact('featured_posts', 'latest_posts')), 200);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user