Implement a caching mechanism

This commit is contained in:
Krzysztof Płaczek committed 2025-05-14 09:03:25 +02:00
1 parent a01174b414
commit e97d976705
2 files changed
+5 -7

No files matched your search

+2 -2
View File
@@ -42,8 +42,8 @@ class CacheWarmCommand extends Command
$progress = new ProgressBar($output);
$progress->start();
$products = Product::with([
'price' => fn($query) => $query->orderBy('created_at', 'desc'),
'stock' => fn($query) => $query->orderBy('created_at', 'desc'),
'price' => fn($query) => $query->orderByDesc('created_at'),
'stock' => fn($query) => $query->orderByDesc('created_at'),
])->get();
$progress->setMaxSteps(count($products));