diff --git a/app/Jobs/SendVisaToSystem.php b/app/Jobs/SendVisaToSystem.php index cff4f5b..3448d92 100644 --- a/app/Jobs/SendVisaToSystem.php +++ b/app/Jobs/SendVisaToSystem.php @@ -27,18 +27,20 @@ class SendVisaToSystem implements ShouldQueue */ public function handle(): void { - $orderItem = VisaMasterPaymentOrderItem::query() + $orderItems = VisaMasterPaymentOrderItem::query() ->where('paid', true) ->where('synced_with_system', false) ->whereDate('created_at', '>', '2025-09-05') - ->first(); + ->limit(2) + ->get() + ->each(function ($orderItem) { + if (! $orderItem) { + return; + } - if (! $orderItem) { - return; - } + $result = syncVisaWithAzatAPI($orderItem); - $result = syncVisaWithAzatAPI($orderItem); - - if (isset($result['error'])) {} + if (isset($result['error'])) {} + }); } }