public function show($id)
 {
     $products = $this->product->findOrThrowException($id);
     if (!$products) {
         return $this->respondNotFound('This Product Not Found');
     }
     return $this->respond(['data' => $this->productTransformer->transform($products->toArray())]);
 }
Beispiel #2
0
 /**
  * @return \Illuminate\Http\RedirectResponse
  */
 public function instance()
 {
     $product = $this->product->eagerLoadWhere('product_translations', \Input::get('id'));
     Cart::add(['id' => \Input::get('id'), 'name' => $product->product_translations[0]->name, 'qty' => 1, 'price' => $product->price, 'options' => ['img' => $product->img_big, 'sku' => $product->sku, 'currency' => $product->currency]]);
     return redirect()->back()->with('flash_success', 'Product is added to the cart');
 }
 /**
  * Delete product beyond recovery.
  *
  * @param $id
  *
  * @return mixed
  */
 public function delete($id)
 {
     $this->product->delete($id);
     return redirect()->back()->withFlashSuccess(trans('alerts.users.deleted_permanently'));
 }
 public function show($id)
 {
     //dd($this->product->eagerLoadWhere('',$id));
     return Theme::view('frontend.product.show')->withProduct($this->product->eagerLoadWhere('', $id))->withProducts($this->product->eagerLoadPaginated(10));
 }