Basic Details

@foreach ($this->products as $product) {{ $product->name }} @endforeach
@foreach($this->categories as $category) {{ $category->name }} @endforeach
@foreach($this->subcategories as $subcategory) {{ $subcategory->name }} @endforeach
@foreach ($this->conditionGrades as $grade) {{ $grade->name }} @endforeach
@foreach ($this->suppliers as $supplier) {{ $supplier->name }} @endforeach
@foreach ($this->locationBins as $bin) {{ $bin->name }} ({{ $bin->warehouse->name }}) @endforeach
@include('admin.inventory-item-edit-specs-section')
@if($this->hasUnsavedChanges()) Unsaved changes @endif

Acquisition Details

@foreach (\App\Models\InventoryItem::ACQUISITION_TYPES as $key => $label) {{ $label }} @endforeach
@foreach (\App\Models\InventoryItem::STATUSES as $key => $label) {{ $label }} @endforeach

Notes

Images

@if($this->inventoryItem->serial_number) @else Serial # required @endif
{{-- Success Messages --}} @if(session()->has('delete-image-success'))
{{ session('delete-image-success') }}
@endif @if(session()->has('reorder-success'))
{{ session('reorder-success') }}
@endif @if(session()->has('upload-success'))
{{ session('upload-success') }}
@endif @if(session()->has('upload-warning'))
{{ session('upload-warning') }}
@endif {{-- Error Messages --}} @error('delete-image')
{{ $message }}
@enderror @error('upload')
{{ $message }}
@enderror {{-- Inventory Images Data --}} @php $inventoryImages = $this->inventoryItem->images()->with('productImage')->get(); // Group images by original filename to avoid duplicates // For shared images, group by product_image_id // For uploaded images, group by original_filename $filteredImages = $inventoryImages->groupBy(function($img) { if ($img->is_shared && $img->productImage) { return 'product_' . $img->product_image_id; } return 'uploaded_' . ($img->original_filename ?? $img->id); })->map(function($group) { // Return the largest variant from each group return $group->sortByDesc(function($img) { if ($img->is_shared && $img->productImage) { return ($img->productImage->width ?? 0) * ($img->productImage->height ?? 0); } return ($img->width ?? 0) * ($img->height ?? 0); })->first(); })->sortBy([ ['is_primary', 'desc'], ['display_order', 'asc'], ]); @endphp @if($filteredImages->isNotEmpty())
@foreach($filteredImages as $image)
{{-- Position and Primary Badge --}}
{{-- Position Input --}}
/ {{ $filteredImages->count() }}
@if($image->is_primary) Primary @else {{-- Set as Primary Button (only for non-primary images) --}} @endif
{{-- Image Preview --}}
{{ $image->alt_text ?? 'Inventory item image' }}
{{-- Image Details --}}
Source: @if($image->is_shared) Product Image @else Uploaded @endif
Dimensions: @php if ($image->is_shared && $image->productImage) { // For shared images, get dimensions from related product images $filename = $image->productImage->original_filename; $allSizes = $inventoryImages ->filter(fn($img) => $img->is_shared && $img->productImage && $img->productImage->original_filename === $filename) ->sortByDesc(fn($img) => $img->productImage->width * $img->productImage->height) ->map(fn($img) => $img->productImage->width . '×' . $img->productImage->height) ->unique() ->values(); } else { $allSizes = $inventoryImages ->where('original_filename', $image->original_filename) ->sortByDesc(fn($img) => $img->width * $img->height) ->map(fn($img) => $img->width . '×' . $img->height) ->unique() ->values(); } @endphp {{ $allSizes->join(', ') }}
Size: @php if ($image->is_shared && $image->productImage) { $filename = $image->productImage->original_filename; $allFileSizes = $inventoryImages ->filter(fn($img) => $img->is_shared && $img->productImage && $img->productImage->original_filename === $filename) ->sortByDesc(fn($img) => $img->productImage->width * $img->productImage->height) ->map(fn($img) => number_format($img->productImage->file_size / 1024, 1) . ' KB') ->values(); } else { $allFileSizes = $inventoryImages ->where('original_filename', $image->original_filename) ->sortByDesc(fn($img) => $img->width * $img->height) ->map(fn($img) => number_format($img->file_size / 1024, 1) . ' KB') ->values(); } @endphp {{ $allFileSizes->join(', ') }}
Format: {{ pathinfo($image->image_path, PATHINFO_EXTENSION) }}
{{-- Delete Button --}}
Delete Image Deleting...
@endforeach
@else
No images available
@endif
{{-- Image Upload Modal --}} @if($showUploadModal) @endif