@include('admin.header', [ 'title' => $product->exists ? 'Edit Product' : 'Add Product', 'active' => 'products', 'searchPlaceholder' => 'Search products, MOQ, specifications...' ])

{{ $product->exists ? 'Edit Product' : 'Add Product' }}

Active, non-archived products appear on the public website.

Back
@csrf @if ($product->exists) @method('PATCH') @endif

Product Details

@error('name')
{{ $message }}
@enderror
@error('slug')
{{ $message }}
@enderror
@error('description')
{{ $message }}
@enderror
@error('moq')
{{ $message }}
@enderror
@error('status')
{{ $message }}
@enderror
@error('sort_order')
{{ $message }}
@enderror
@error('images.*')
{{ $message }}
@enderror @if ($product->images)
@foreach ($product->images as $image) @endforeach
@endif

@php $catalogProductTypes = array_flip($catalogProducts); $selectedBatchIds = collect(old('existing_batch_ids', $product->exists ? $product->availableBatches()->pluck('id')->all() : [])) ->map(fn ($id) => (string) $id) ->all(); @endphp

Batch Connection

Choose one or more available batches to connect this product with batch-wise lab reports. Sold-out batches are kept in history and hidden from this dropdown.

@error('existing_batch_ids')
{{ $message }}
@enderror @error('existing_batch_ids.*')
{{ $message }}
@enderror @if ($availableBatches->isEmpty())
No unlinked available batches right now. Create one from Batch Lab Reports first.
@else
Select a product name to show matching available batches.
@endif
Selected Batches

Specifications

@php($specs = old('specifications', $product->specificationRows() ?: [['label' => '', 'value' => ''], ['label' => '', 'value' => ''], ['label' => '', 'value' => '']]))
@foreach ($specs as $index => $row)
@endforeach

Packaging Details

@php($packs = old('packaging_details', $product->packagingRows() ?: [['label' => '', 'value' => ''], ['label' => '', 'value' => ''], ['label' => '', 'value' => '']]))
@foreach ($packs as $index => $row)
@endforeach

@error('seo_title')
{{ $message }}
@enderror
@error('seo_description')
{{ $message }}
@enderror
Cancel
@include('admin.footer')