@extends('layouts.app') @section('title', 'Edit Produk') @push('styles') @endpush @section('content') @php /** @var \Illuminate\Support\Collection $categories */ /** @var \App\Models\Product|array|null $produk */ $routeProduct = $produk; if (! is_object($produk)) { $produk = (object) ($produk ?? []); } $product = $produk; $subcategoryMap = $categories->mapWithKeys(function ($category) { return [ (string) $category->id => $category->children->map(function ($child) { return [ 'value' => $child->slug, 'label' => $child->name, ]; })->values()->all(), ]; })->all(); $currentType = old('type', $product->type); @endphp
{{-- Ambient Light penambah kontras --}}
{{-- Header Form --}}
Modify Commodities

Edit Detail Produk

Perbarui spesifikasi atau sesuaikan harga komoditas lapak jualan Anda.

{{-- Error Validation Alert --}} @if ($errors->any())
Refusal Alert: Ada beberapa kesalahan data input:
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif {{-- Form Start --}}
@csrf @method('PUT') {{-- Row 1: Nama & Harga --}}
Nama Produk
Harga (Rp)
{{-- Row 2: Kategori & Jenis --}}
Kategori Game
Sub Kategori Produk
{{-- Row 3: Stok & Status Publikasi --}}
Jumlah Stok
Status Visibilitas Lapak
{{-- Row 4: Galeri Foto Manajemen --}}
Manajemen Galeri Foto {{-- Existing Images Section --}} @if($product->image_paths)

Foto Saat Ini (Hover & klik tong sampah untuk hapus)

@foreach($product->image_paths as $index => $imagePath) @php $imageUrl = str_starts_with($imagePath, 'http') ? $imagePath : asset('storage/' . ltrim($imagePath, '/')); @endphp
Produk {{ $index + 1 }}

{{ basename($imagePath) }}

@endforeach
{{-- Hidden input to track removed images --}} @endif {{-- New Images Upload Section --}}
Tambah Foto Tambahan

Pilih file gambar jika ingin menambahkan aset foto baru. Batas maksimal 5 MB per berkas foto.

{{-- New Images Preview Section --}}
{{-- Row 5: Deskripsi --}}
Deskripsi / Cara Reedem / Informasi Akun
{{-- Form Actions Footer --}}
BATALKAN PERUBAHAN
@endsection