/**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Requests\ProductRequest $request)
 {
     $input = $request->except('tag');
     $imputTag = $request->input('tag');
     $tags = explode(',', $imputTag);
     $products = $this->productModel->fill($input);
     $products->save();
     $this->storeTag($tags, $products->id);
     return redirect()->route('products.index');
 }
 public function update(ProductRequest $request, $id)
 {
     $product = $this->productModel->find($id);
     $product->update($request->except('tags_prod'));
     if ($request->has('tag_list')) {
         $this->tagsControl($product, $request->input('tag_list'), false);
     } else {
         if (count($product->tags) > 0) {
             $product->tags()->detach();
         }
     }
     return redirect()->route('products.index');
 }