Sync
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user