public function update(Requests\ProductRequest $request, $id)
 {
     $this->productModel->findOrNew($id)->update($request->all());
     $input = array_map('trim', explode(',', $request->get('tags')));
     $this->storeTag($input, $id);
     return redirect()->route('products')->with('product_update', 'Product updated!');
 }
 public function update(Requests\ProductRequest $request, \CodeCommerce\Product $product)
 {
     $product->featured = null;
     $product->recommend = null;
     $tagIds = $this->getTagIds($request->get('tags'));
     $product->update($request->all());
     $product->tags()->sync($tagIds);
     return redirect()->route('products.index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\ProductRequest  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\ProductRequest $request, $id)
 {
     $input = $request->all();
     $input['featured'] = $request->get('featured') ? true : false;
     $input['recommend'] = $request->get('recommend') ? true : false;
     $arrayTags = $this->tagToArray($input['tags']);
     $this->productModel->find($id)->update($input);
     $product = Product::find($id);
     $product->tags()->sync($arrayTags);
     return redirect()->route('admin.products.index');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Requests\ProductRequest $request)
 {
     $input = $request->all();
     $inputTags = explode(' ', $request->get('getTagListAttribute'));
     $a = ['a', 'b', 'c'];
     foreach ($a as $i) {
         echo $i . "\n";
     }
     $resp = array_diff($inputTags, $a);
     return $resp;
     //$product    = $this->productModel->fill($input);
     //$product    ->save();
     //return redirect()->route('products');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\ProductRequest $request, $id)
 {
     $request['featured'] = $request->get('featured');
     $request['recommended'] = $request->get('recommended');
     $this->model->find($id)->update($request->all());
     $product = $this->model->find($id);
     $product->tags()->sync($this->getTagsIds($request->tags));
     $product->colors()->sync($this->getColorsIds($request->color));
     return redirect()->route('admin.products');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param ProductRequest|Request $request
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function update(ProductRequest $request, $id)
 {
     $this->product->find($id)->update($request->all());
     $this->syncTags($request->get('tag_list'), $id);
     return redirect()->route('admin.products.index');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(Requests\ProductRequest $request, $id)
 {
     $product = $this->productModel->find($id);
     $product->fill($request->all())->save();
     $tags = $this->tags_to_array($request->get('taglist'));
     $product->tags()->sync($tags);
     return redirect()->route('admin.products');
 }