@php $decimalNow = $errors->any() ? (bool) old('allow_decimal') : (bool) $product->allow_decimal; $activeNow = $errors->any() ? (bool) old('is_active') : (bool) ($product->is_active ?? true); $input = 'mt-1 w-full rounded-lg border-gray-300 text-sm focus:border-indigo-500 focus:ring-indigo-500'; $tiersInit = $errors->any() ? array_values((array) old('tiers', [])) : $product->prices->map(fn ($t) => ['min_qty' => (float) $t->min_qty, 'price' => (int) $t->price])->values()->all(); @endphp