public function new_mortgage($nav, $action, $id_retailer_products, $code_product, $type) { $main_menu = $this->menu_principal(); $array_data = $this->array_data(); $query_retailer = \DB::table('ad_retailers')->first(); $query_product = Product::where('code', $code_product)->first(); $query_product_credit = \DB::table('ad_credit_products as cprd')->where('ad_retailer_product_id', $id_retailer_products)->where('slug', 'PMO')->first(); //dd($query_product_credit); return view('admin.tasas.new-mortgage', compact('nav', 'action', 'id_retailer_products', 'code_product', 'type', 'main_menu', 'array_data', 'query_retailer', 'query_product', 'query_product_credit')); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request) { try { $query_update = Product::where('id', $request->input('id_product'))->first(); $query_update->name = $request->input('txtProducto'); $query_update->code = $request->input('txtCodigo'); $query_update->type = $request->input('id_tipo'); $query_update->slug = strtolower($request->input('txtProducto')); if ($query_update->save()) { return redirect()->route('admin.product.list', ['nav' => 'product', 'action' => 'list'])->with(array('ok' => 'Se edito correctamente los datos del formulario')); } } catch (QueryException $e) { return redirect()->back()->with(array('error' => $e->getMessage())); } }