Inventory Management

@if($search || $filterByStatus || $filterByProduct) @endif
@if(session('success'))

{{ session('success') }}

@endif
SKU Acquisition Date Value Status @foreach ($inventoryItems as $item) @endforeach
Brand Product Category Subcategory Condition Location Actions
{{ $item->brand?->name ?? 'N/A' }} {{ $item->product_name ?? 'N/A' }} {{ $item->category?->name ?? 'N/A' }} {{ $item->subcategory?->name ?? 'N/A' }} {{ $item->sku }} {{ $item->conditionGrade?->name ?? 'N/A' }} {{ $item->bin?->name ?? 'N/A' }} {{ $item->acquisition_date?->format('M d, Y') ?? 'N/A' }} @if($item->current_value) ${{ number_format($item->current_value, 2) }} @else N/A @endif {{ \App\Models\InventoryItem::STATUSES[$item->status] ?? $item->status }}
View
{{ $inventoryItems->links() }}
@if($isEditing) {{-- Edit Mode: Show original form --}}

Edit Inventory Item

@error('model_id') {{ $message }} @enderror
@foreach (\App\Models\InventoryItem::STATUSES as $key => $label) {{ $label }} @endforeach
Save Changes Cancel
@else {{-- Create Mode: Two-step interface --}}

{{ $model_id ? 'Complete Inventory Details' : 'Select Product' }}

@if(!$model_id)

Search and select the product you want to add to inventory

@endif
@if(!$model_id) {{-- Step 1: Product Selection --}} @else {{-- Step 2: Inventory Details --}}
{{-- Show selected product --}} @php $selectedProduct = $products->firstWhere('id', $model_id); @endphp @if($selectedProduct)

Selected Product

{{ $selectedProduct->brand?->name }} {{ $selectedProduct->name }}

@endif
@if($quantity == 1) @endif @foreach (\App\Models\InventoryItem::STATUSES as $key => $label) {{ $label }} @endforeach
@endif
@if($model_id) Create Item Back @else Cancel @endif
@endif
{{-- Bulk Edit Modal --}}

Bulk Edit {{ $bulkEditCount }} Items

Only showing fields with identical values across all selected items. @if($bulkEditCount >= 100) Limited to first 100 items. @endif

@if(empty($commonFields))

No common fields found. Selected items have different values for all editable fields.

@else @if(array_key_exists('status', $commonFields))
Status @error('bulkEditData.status') {{ $message }} @enderror
@endif @if(array_key_exists('is_featured', $commonFields))
Featured Mark items as featured (shown first in inventory) @error('bulkEditData.is_featured') {{ $message }} @enderror
@endif @if(array_key_exists('acquisition_type', $commonFields))
Acquisition Type @error('bulkEditData.acquisition_type') {{ $message }} @enderror
@endif @if(array_key_exists('acquisition_date', $commonFields))
Acquisition Date @error('bulkEditData.acquisition_date') {{ $message }} @enderror
@endif @if(array_key_exists('acquisition_cost', $commonFields))
Acquisition Cost @error('bulkEditData.acquisition_cost') {{ $message }} @enderror
@endif @if(array_key_exists('current_value', $commonFields))
Current Value @error('bulkEditData.current_value') {{ $message }} @enderror
@endif @if(array_key_exists('category_id', $commonFields))
Category @foreach(\App\Models\Category::all() as $category) @endforeach @error('bulkEditData.category_id') {{ $message }} @enderror
@endif @if(array_key_exists('subcategory_id', $commonFields))
Subcategory @php $categoryId = $bulkEditData['category_id'] ?? null; $subcategories = $categoryId ? \App\Models\Subcategory::where('category_id', $categoryId)->get() : \App\Models\Subcategory::all(); @endphp @foreach($subcategories as $subcategory) @endforeach @error('bulkEditData.subcategory_id') {{ $message }} @enderror
@endif @if(array_key_exists('condition_grade_id', $commonFields))
Condition @foreach(\App\Models\ConditionGrade::all() as $grade) @endforeach @error('bulkEditData.condition_grade_id') {{ $message }} @enderror
@endif @if(array_key_exists('bin_id', $commonFields))
Location @foreach(\App\Models\LocationBin::all() as $bin) @endforeach @error('bulkEditData.bin_id') {{ $message }} @enderror
@endif @if(array_key_exists('product_specs', $commonFields) && !empty($commonFields['product_specs']))

Common Product Specifications

@foreach($bulkEditData['product_specs'] as $index => $spec)
Field Name @error('bulkEditData.product_specs.'.$index.'.key') {{ $message }} @enderror
Value @error('bulkEditData.product_specs.'.$index.'.value') {{ $message }} @enderror
@endforeach

Only specs with identical values across all items are shown. You can rename fields or change values. Changes will be merged with existing specs.

@endif

About this bulk edit

Only fields shown above have the same value across all {{ $bulkEditCount }} filtered items. Fields like SKU, Serial Number, and any fields with different values are excluded from bulk editing.

@endif
Cancel @if(!empty($commonFields)) Update {{ $bulkEditCount }} Items @endif