@php $variantRows = old('variants', $product->variants->map(fn ($variant) => $variant->only('id', 'sku', 'attribute_combination_json', 'price', 'stock', 'status'))->all()); $publishedAt = old('published_at', $product->published_at?->format('Y-m-d\TH:i')); @endphp
@csrf @if ($product->exists) @method('PUT') @endif
$errors->has('name')]) data-saruar-slug-target="#productSlugInput"> @error('name')
{{ $message }}
@enderror
$errors->has('slug')]) @if ($product->exists) data-saruar-slug-locked @endif>
saruar-mart.example/products/{{ old('slug', $product->slug) }}
@error('slug')
{{ $message }}
@enderror
{{ mb_strlen((string) old('short_description', $product->short_description)) }} / 300 characters
@error('short_description')
{{ $message }}
@enderror
Unsafe HTML is removed when you save.

Variants

@if ($attributes->isNotEmpty())
@foreach ($attributes as $attribute)
@endforeach
@else

Add an attribute under Attributes to generate variants.

@endif
@foreach (array_values($variantRows) as $index => $row) @php $combination = is_array($row['attribute_combination_json'] ?? null) ? $row['attribute_combination_json'] : (json_decode($row['attribute_combination_json'] ?? '', true) ?: []); @endphp @include('admin.products.partials.variant-row', ['index' => $index, 'row' => $row, 'label' => collect($combination)->map(fn ($value, $name) => "{$name}: {$value}")->implode(' / ')]) @endforeach
CombinationSKUPriceStockStatusRemove
$errors->has('published_at')])> @error('published_at')
{{ $message }}
@enderror
$errors->has('price')])> @error('price')
{{ $message }}
@enderror
$errors->has('sale_price')])> @error('sale_price')
{{ $message }}
@enderror
@error('card_tag')
{{ $message }}
@enderror
$errors->has('sku')])> @error('sku')
{{ $message }}
@enderror

Search Preview

M/s.Saruar Mart › products ›