20 lines
477 B
PHP
20 lines
477 B
PHP
<?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();
|
|
});
|
|
}
|
|
}
|