/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(CategoryRequest $request, $id) { $input = $request->all(); $productCategory = ProductCategory::findOrFail($id); $productCategory->update($input); return redirect("ProductCategory"); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $product = Products::findOrFail($id); $CategoryList = ProductCategory::Lists('product_category_name', 'id'); $TypeList = ProductType::Lists('product_type_name', 'id'); return view('product.productInfoEdit', ['product' => $product, 'CategoryList' => $CategoryList, 'TypeList' => $TypeList]); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $product_type = ProductType::findOrFail($id); $CategoryList = ProductCategory::Lists('product_category_name', 'id'); return view('product.productTypeEdit', ['CategoryList' => $CategoryList, 'product_type' => $product_type]); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $productCategory = ProductCategory::all(); return view('product_sub_category.addProductSubCategory', ['productCategories' => $productCategory]); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($slug) { $productCategory = ProductCategory::whereSlug($slug)->first(); return response()->json(['productCategory' => $productCategory]); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $Category = ProductCategory::findOrFail($id); return response()->json($Category); }