get choosen item id
i have this code
i want get choosen item id to pass for exlcuded_item_id
i want get choosen item id to pass for exlcuded_item_id
$total_amount = Pay::where('purchase_id', $purchase_id)
->where('item_id', '!=', $excluded_item_id) // Exclude the specific item
->sum('amount');