From 46597c14b07d7db0d2eaaf380250194e73080664 Mon Sep 17 00:00:00 2001 From: Charles T Date: Tue, 28 Nov 2023 05:20:10 +0800 Subject: [PATCH] Sync --- app/View/Composers/StatsComposer.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/View/Composers/StatsComposer.php b/app/View/Composers/StatsComposer.php index 361eb10..8635a10 100644 --- a/app/View/Composers/StatsComposer.php +++ b/app/View/Composers/StatsComposer.php @@ -2,13 +2,19 @@ namespace App\View\Composers; +use App\Models\AiTool; use Illuminate\View\View; +use Illuminate\Support\Facades\Cache; + class StatsComposer { public function compose(View $view) { - $tools_count = round_to_nearest_base(700); + // Retrieve the count from the cache or count and store it if not present + $tools_count = Cache::remember('tools_count', 10800, function () { + return AiTool::count(); + }); $view->with('tools_count', $tools_count);