Add (initial): futurewalker code

This commit is contained in:
2023-11-20 00:15:18 +08:00
parent f8602cb456
commit 9ce3e5c82a
166 changed files with 15941 additions and 1072 deletions

View File

@@ -13,12 +13,18 @@ class FrontHomeController extends Controller
{
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]);
})->where('status', 'publish')->orderBy('published_at', 'desc')->limit(5)->get();
// $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]);
// })->where('status', 'publish')->orderBy('published_at', 'desc')->limit(5)->get();
return response(view('front.welcome', compact('featured_post', 'latest_posts')), 200);
$featured_posts = Post::where('status', 'publish')->where('published_at', '<=', now())->orderBy('published_at', 'desc')->limit(6)->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();
return response(view('front.welcome', compact('featured_posts', 'latest_posts')), 200);
}
public function terms(Request $request)
@@ -70,7 +76,7 @@ public function disclaimer(Request $request)
$markdown = file_get_contents(resource_path('markdown/disclaimer.md'));
$title = 'Disclaimer';
$description = 'EchoScoop provides the content on this website purely for informational purposes and should not be interpreted as legal, financial, or medical guidance.';
$description = 'FutureWalker provides the content on this website purely for informational purposes and should not be interpreted as legal, financial, or medical guidance.';
SEOTools::metatags();
SEOTools::twitter();