@extends('admin.layout.template') @section('title','Edit Product') @php $locations=App\Models\Location::all(); @endphp @section('content')
Product Details
@csrf
{{-- Product Name --}}
{{-- Material --}} {{-- Pattern --}} {{-- Features --}}
{{-- Warranty --}}
{{-- Maintenance --}}
{{-- Rooms (Multiple) --}}
{{-- Tags (Multiple) --}}
{{-- Measurement --}} @php // Split measurement string safely $measurements = $product->measurement ? array_map('trim', explode('x', $product->measurement)) : []; $length = $measurements[0] ?? ''; $width = $measurements[1] ?? ''; $height = $measurements[2] ?? ''; @endphp
Example: 120 x 60 x 45 cm
{{-- Description --}}
@include('admin.product.variant-form')
@foreach($product->variants as $index => $variant)
@csrf
Variant {{ $index + 1 }} {{ $variant->color_name ?? 'No Color' }}
{{-- Dimensions (L × W × H) --}} @php $dim = is_array($variant->dimensions) ? $variant->dimensions : json_decode($variant->dimensions, true); @endphp
@endforeach
@foreach($product->variants as $index => $variant)
@csrf
Images – Variant {{ $index + 1 }} {{ $variant->color_name ?? 'No Color' }}
{{-- Upload --}} {{-- Preview --}}
{{-- Existing Images --}}
@forelse($variant->images as $img)
@empty

No images uploaded

@endforelse
@endforeach
@csrf
Stock Management
@foreach($product->variants as $variant) @php $existingStocks = $variant ? $variant->stocks : collect(); @endphp @if(!empty($existingStocks)) @foreach($existingStocks as $index => $stock)
{{-- stock id (for update) --}}
{{-- Location --}}
{{-- Available Qty --}}
{{-- Opening Qty --}}
{{-- Received Qty --}}
{{-- Damaged Qty --}}
{{-- Returned Qty --}}
{{-- Remove --}}

@endforeach @endif @endforeach
@endsection