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

22 lines
575 B
PHP
Raw Normal View History

2026-06-10 18:25:05 +03:30
<?php
namespace App\Console\Commands;
use App\Services\ProductPriceSyncService;
use Illuminate\Console\Command;
class SyncProductPrices extends Command
{
protected $signature = 'product:sync-prices';
2026-06-11 19:23:16 +03:30
protected $description = 'Fetch zaarbox price board + sync product DB (scheduler: every 30s)';
2026-06-10 18:25:05 +03:30
public function handle(ProductPriceSyncService $syncService): int
{
2026-06-11 19:23:16 +03:30
// کران: GET https://price.zaarbox.ir/api/free (یا zaarbox_api_url) → کش + UPDATE محصولات
2026-06-10 18:38:01 +03:30
$syncService->syncAll(true);
2026-06-10 18:25:05 +03:30
return self::SUCCESS;
}
}