{{ $product->exists ? __('admin.edit_product') : __('admin.new_product') }}

@csrf @if ($product->exists) @method('PUT') @endif
{{ __('admin.images_help') }} @for ($slot = 1; $slot <= 7; $slot++) @php $image = $product->exists ? $product->images->firstWhere('slot', $slot) : null; @endphp

{{ $slot === 1 ? __('admin.main_image') : __('admin.extra_image', ['n' => $slot - 1]) }}

@if ($image) @endif @if ($image && $slot > 1)
@endif
@endfor
@if ($product->exists) @foreach ($product->images as $image) @if ($image->slot > 1)
@csrf
@csrf
@endif @endforeach @endif @if ($product->exists)
@csrf @method('DELETE')
@endif