@php $rules = old('rules'); $rule = (object)($rules[$ruleIdx] ?? $ruleNGift ?? []); $qnty = $rule->qnty ?? 0; $topAction = $rule->top_action ?? 0; $topOrder = $rule->top_order ?? 0; $productId = $rule->product_id ?? $rule->product->id ?? 0; $invitationType = $rule->invitation_type ?? 0; $gift = (object)($rule->gift ?? []); $voucherQnty = $gift->voucher_qnty ?? $gift->gift_voucher_qnty ?? 0; $voucherId = $gift->voucher_id ?? $gift->gift_voucher_id ?? 0; $giftProductQnty = $gift->product_qnty ?? $gift->gift_product_qnty ?? $gift->gift_product->qnty ?? 0; $giftProductId = $gift->product_id ?? $gift->gift_product_id ?? $gift->gift_product->id ?? 0; @endphp