Пример #1
0
 /**
  * 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]);
 }
Пример #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $input = $request->all();
     $product = ProductType::findOrFail($id);
     $product->update($input);
     return redirect('ProductType');
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $type = ProductType::findOrFail($id);
     return response()->json($type);
 }