Example #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(SaveProductRequest $request, Product $product)
 {
     $product->fill($request->all());
     $product->slug = str_slug($request->get('name'));
     $product->visible = $request->has('visible') ? 1 : 0;
     $updated = $product->save();
     $message = $updated ? 'Producto actualizado correctamente!' : 'El Producto NO pudo actualizarse!';
     return redirect()->route('admin.product.index')->with('message', $message);
 }
Example #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(SaveProductRequest $request, Product $product)
 {
     $product->fill($request->all());
     $product->slug = str_slug($request->get('name'));
     $product->visible = $request->has('visible') ? 1 : 0;
     $updated = $product->save();
     $message = $updated ? 'Product was updated successfully!' : 'Could not update product!';
     return redirect()->route('admin.product.index')->with('message', $message);
 }