/**
  * Handle the command.
  *
  * @param  UpdateProduct $command
  * @return void
  */
 public function handle(UpdateProduct $command)
 {
     $this->productRepository->update($command->productId, $command->input);
     $modelNumber = $this->productRepository->findLastSavedModelNumber();
     $imageCount = $this->imageRepository->count() + 1;
     $this->imageRepository->uploadImages($command->input['images'], $modelNumber, $command->productId, $imageCount);
 }
 public function approve($id)
 {
     $product = $this->productRepository->findWithoutFail($id);
     if (empty($product)) {
         Flash::error('Tracking not found');
         return back();
     }
     $this->productRepository->update(["state" => "Approved"], $id);
     Flash::success('Product approved!');
     return back();
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $this->validate($request, ['name' => 'required|max:255', 'quantity' => 'required', 'item_price' => 'required']);
     $this->products->update($id, $request->input('name'), $request->input('quantity'), $request->input('item_price'));
     return redirect('/');
 }
 /**
  * Update the specified product in storage.
  *
  * @param  int $id
  * @param ProductRequest $request
  * @return Response
  */
 public function update($id, ProductRequest $request)
 {
     $this->productRepository->update($id, $request->all());
     Flash::message('Updated Product');
     return Redirect()->route('products');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int $id
  * @param ProductFrontRequest $request
  * @return Response
  */
 public function update($id, ProductFrontRequest $request)
 {
     $this->productRepository->update($id, $request->all());
     Flash('Producto Actualizado');
     return Redirect()->route('profile.show', Auth()->user()->username);
 }