Files
isaaccladandCursor e3ef23218f
Deploy Ladill Woo Manager / deploy (push) Successful in 39s
Fix Woo sync: exempt webhooks from CSRF and backfill on connect.
Auto-import catalog and orders after store activation, add manual order sync, and allow WooCommerce webhooks without CSRF tokens.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 00:15:37 +00:00

35 lines
739 B
PHP

<?php
namespace App\Jobs;
use App\Models\WooStore;
use App\Services\Woo\StoreSyncService;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Support\Facades\Log;
class StoreBootstrapSync
{
use Queueable;
public function __construct(public int $storeId) {}
public function handle(StoreSyncService $sync): void
{
$store = WooStore::query()
->whereKey($this->storeId)
->where('status', WooStore::STATUS_ACTIVE)
->first();
if (! $store) {
return;
}
$counts = $sync->syncAll($store);
Log::info('Woo store bootstrap sync completed', [
'store_id' => $store->id,
'counts' => $counts,
]);
}
}