<div class="table-responsive mb-0"
     data-list="{&quot;valueNames&quot;: [&quot;goal-project&quot;, &quot;goal-status&quot;, &quot;goal-progress&quot;, &quot;goal-date&quot;]}">
    <table class="table table-sm table-nowrap card-table">
    <thead>
    <tr>
        <th>S/N</th>
        <th>Product Name</th>
        <th>Total Stock</th>
        <th>Reorder Level</th>
        <th>Expiry</th>
        <th>Action</th>
    </tr>
    </thead>

    <tbody>
    <?php $i = 0; ?>
    @isset($inventories)
        @foreach($inventories as $inventory)
            <tr>
                <td><?= ++$i; ?></td>
                {{--            {{dd(json_encode($inventory->product()))}}--}}
                <?php $product = \App\Models\Product::where('id', $inventory->product_id)->first();?>
                <td>{!!$product->name!!} - {!!$product->description!!} </td>
                <td>{!!$inventory->quantity!!}</td>
                <td>{!!$inventory->reorder_level!!}</td>
                <td>{!!$inventory->expiry_date!!}</td>
                <td>
                    <div class="btn-group">
                        <button type="button" class="btn btn-primary btn-raised">Action</button>
                        <button type="button" class="btn btn-primary btn-raised dropdown-toggle"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            <i class="zmdi zmdi-chevron-down right only"></i>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-primary">
                            <li class="" disabled>
                                <a href="{{route('member_edit_inventory', $inventory->id)}}">Edit</a>
                            </li>
                            <li class="" disabled>
                                <a href="{{route('member_add_inventory', ['product_id='.$inventory->product_id, 'quantity='.$inventory->quantity])}}">Add</a>
                            </li>
                            <li disabled>

                                <a href="{{url('member/product/'.$inventory->id.'/delete')}}" id="delete-btn" onclick="return confirm('Are you sure you want to delete the product?')" data-action="{{'/product/'.$inventory->id.'/delete'}}">Delete</a>
                            </li>

                            <li disabled>
                                <a href="{{url('member/product/'.$inventory->id)}}">Details</a>
                            </li>
                            <li role="separator" class="divider"></li>
                        </ul>
                    </div>
                </td>
            </tr>
        @endforeach

        @endisset

    </tbody>
</table>
</div>
