public function updateClothes(Request $request, $id) { $valid = Self::val($request, true); if ($valid->fails()) { return redirect('dashboard/clothes/edit/' . $id)->withErrors($valid)->withInput($request->input()); } $product = Product::find($id); $product->colors()->detach(); $this->fillData($request, $product, true); return redirect()->action('DashboardController@index'); }