Implement a caching mechanism

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

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));