@extends('admin.layouts.master') @section('title', 'Add Product Inventory') @section('content')
Head Office Inventory Manage Inventory
@foreach ($productInventoryDetails as $id => $inventory) @php $latestInventoryDetail = \App\Models\ProductInventoryDetail::find( $inventory->latest_id, ); $latestInventory = \App\Models\ProductInventory::where( 'product_id', $inventory->product_id, ) ->orderBy('created_at', 'desc') ->first(); if ($latestInventoryDetail->product->stock == 'out_of_stock') { $stock_bg = 'danger'; } elseif ($latestInventoryDetail->product->stock == 'normal') { $stock_bg = 'primary'; } else { $stock_bg = 'warning'; } @endphp @endforeach
{{ __('#') }} {{ __('Image') }} {{ __('Product Name') }} {{ __('Quantity') }} {{ __('Date') }} {{ __('Current Stock') }} {{ __('Threshold') }} {{ __('Action') }}
{{ ++$id }} @if ($latestInventoryDetail->product && $latestInventoryDetail->product->image) product Image @else No Image @endif {{ $latestInventoryDetail->product->category->category_name }}- {{ $latestInventoryDetail->product->subCategory->sub_category_name }}- {{ $latestInventoryDetail->product->product_name }} {{ $latestInventoryDetail->quantity }} {{ \Carbon\Carbon::parse($latestInventoryDetail->created_at)->format('d-m-Y') }} {{ $latestInventory ? $latestInventory->current_stock : 0 }}{{ str_replace('_', ' ', $latestInventoryDetail->product->stock) }} {{ $latestInventoryDetail->product->threshold }} Detail
@endsection