I have a products table and unique column, but when I try to update it fails and show me unique error message.I try to make something to ignore, but does not work.
$attributes = $request->validate([
'name' => 'required|min:3',
'description' => 'nullable|min:3',
'selling_price' => 'required|numeric',
'purchase_price' => 'required|numeric',
'quantity' => 'required|integer',
'unit' => 'nullable',
'stock_alert' => 'nullable|numeric',
'unique_code' => "required|unique:products,unique_code,$product->id",
'awb' => 'required|numeric'
]);
Thank you so much!
"required|unique:products,unique_code,". $product->id. To make store method, justrequired|unique:products