The issue is occurring because the Livewire component is rendering two rows for the same product. One solution is to group the products by their ProductID and then loop through the groups to render the table rows. Here's an example code snippet:
$spProducts = DB::table($this->prdTable)
->select('*')
->whereIn('GroupID', $this->grpID)
->offset($startIndex)
->limit($itemsPerPage)
->get();
$productGroups = $spProducts->groupBy('ProductID');
foreach ($productGroups as $productId => $products) {
<tr>
<td><input type="checkbox" value="{{ $productId }}"></td>
<td>{{ $productId }}</td>
<td>{{ $products[0]->GroupID }}</td>
<td>{{ $products[0]->Snmbr }}</td>
</tr>
}
In this example, we first group the products by their ProductID using the groupBy method. Then, we loop through each group and render a table row with a single checkbox for the product and the other relevant information. Since each group represents a unique product, we only render one checkbox per product.
