@error('category_id')
{{ $message }}
@enderror
@error('product_name')
{{ $message }}
@enderror
@error('tax')
{{ $message }}
@enderror
@error('is_display')
{{ $message }}
@enderror
@foreach ($types as $type)
type_id)) && in_array($type->id, old('type', $products->type_id)) ? 'checked' : '' }}>
@endforeach
@error('type')
{{ $message }}
@enderror
@error('description')
{{ $message }}
@enderror
@php
$isSubmitted = old('_token') !== null;
$isIngredientsChecked = $isSubmitted
? (bool) old('has_ingredients_nutrition')
: !empty($products->ingredients_nutrition);
$rawCombo = $products->combo_items ?? [];
if (is_string($rawCombo)) {
$rawCombo = json_decode($rawCombo, true) ?: [];
}
$isComboChecked = $isSubmitted
? (bool) old('has_combo_products')
: !empty($rawCombo);
$comboRows = old('combo_items');
if (!is_array($comboRows)) {
$comboRows = !empty($rawCombo) ? $rawCombo : [['product_name' => '', 'quantity' => '', 'unit' => '']];
}
if (empty($comboRows)) {
$comboRows = [['product_name' => '', 'quantity' => '', 'unit' => '']];
}
@endphp
@foreach ($comboRows as $index => $row)
@endforeach
@error('combo_items')
{{ $message }}
@enderror