Update (home): Fix broken logic
This commit is contained in:
@@ -15,7 +15,7 @@ public function home(Request $request)
|
||||
{
|
||||
$featured_post = Post::where('status', 'publish')->orderBy('published_at', 'desc')->first();
|
||||
$latest_posts = Post::where(function ($query) use ($featured_post) {
|
||||
$query->whereNotIn('id', [$featured_post->id]);
|
||||
$query->whereNotIn('id', [$featured_post?->id]);
|
||||
})->where('status', 'publish')->orderBy('published_at', 'desc')->limit(5)->get();
|
||||
|
||||
return response(view('front.welcome', compact('featured_post', 'latest_posts')), 200);
|
||||
|
||||
Reference in New Issue
Block a user