Files
boursecu_server/app/Console/Commands/RefreshZaarboxPrices.php
T

28 lines
719 B
PHP
Raw Normal View History

2026-06-02 12:24:54 +03:30
<?php
namespace App\Console\Commands;
use App\Services\ZaarboxPriceService;
use Illuminate\Console\Command;
class RefreshZaarboxPrices extends Command
{
protected $signature = 'prices:refresh-zaarbox';
protected $description = 'Fetch gold price history from Zaarbox and store in cache';
public function handle(ZaarboxPriceService $zaarboxPriceService): int
{
$prices = $zaarboxPriceService->refreshCache();
$this->info(sprintf(
'Zaarbox prices cached: DAILY=%d, WEEKLY=%d, MONTHLY=%d',
count($prices['DAILY'] ?? []),
count($prices['WEEKLY'] ?? []),
count($prices['MONTHLY'] ?? []),
));
return self::SUCCESS;
}
}