Update (fix): tool count display issue

This commit is contained in:
2023-11-29 12:54:29 +08:00
parent 6580463fcb
commit 26d465e3aa
5 changed files with 27 additions and 13 deletions

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Helpers\FirstParty\Cached;
use App\Models\AiTool;
use Illuminate\Support\Facades\Cache;
class Cached
{
public static function tools_count()
{
$seconds_to_remember = 599;
// Retrieve the count from the cache or count and store it if not present
return Cache::remember('tools_count_' . $seconds_to_remember, $seconds_to_remember, function () {
return AiTool::where('status','live')->count();
});
}