public function update($id, Request $request)
 {
     $this->validate($request, ['name' => 'required|min:2|max:10']);
     $product = Product::findOrFail($id);
     $product->name = $request->name;
     $product->save();
     return redirect('products/' . $id);
 }
 public function remove($id, Request $request)
 {
     $jenis = Product::findOrFail($id);
     if ($request->ajax()) {
         $company->delete($request->all());
         return response(['msg' => 'Company deleted', 'status' => 'success']);
     }
     return response(['msg' => 'Failed deleting the company', 'status' => 'failed']);
 }