public function update(AdminProductRequest $request, $id)
 {
     $product = $this->repository->find($id);
     $data = $request->all();
     $this->repository->update($data, $id);
     return redirect()->route('admin.products.index');
 }
 public function update(AdminProductRequest $request, $id)
 {
     try {
         $data = $request->all();
         return $this->repository->update($data, $id);
     } catch (ModelNotFoundException $e) {
         return ['error' => true, 'message' => 'Not updated!'];
     } catch (\Exception $e) {
         return ["error" => true, "message" => $e->getMessage()];
     }
 }
 public function store(AdminProductRequest $request)
 {
     $data = $request->all();
     $this->repository->create($data);
     return redirect()->route('admin.products.index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(AdminProductRequest $request, $id)
 {
     $inputs = $request->all();
     $this->productRepository->update($inputs, $id);
     return redirect()->route('admin.products.index');
 }
 public function update(AdminProductRequest $request, $id)
 {
     $data = $request->all();
     $this->repository->update($data, $id);
     return redirect()->route('admin.products.index')->with('sweet_alert.success', 'Feito!');
 }