/**
  * Update the specified resource in storage.
  *
  * @param $categoryId
  * @param $productId
  * @param  int $id
  * @return Response
  */
 public function update($categoryId, $productId, $id)
 {
     $this->updaterar->validator($this->request);
     $category = Category::with('products')->findOrFail($categoryId);
     $product = Product::findOrFail($productId);
     $picture = $product->pictures()->find($id);
     $this->updaterar->update($this->request->all(), $category, $product, $picture);
     return redirect()->route('category.products.pictures.index', compact('categoryId', 'productId'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $mainPageCategory = Category::with('products.reviews', 'products.categories')->mainPage()->first();
     return view('pages.index', compact('mainPageCategory'));
 }