Example #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($publicId)
 {
     $product = Product::withTrashed()->scope($publicId)->firstOrFail();
     Utils::trackViewed($product->getDisplayName(), ENTITY_PRODUCT);
     $data = array('showBreadcrumbs' => false, 'product' => $product, 'title' => trans('texts.view_product'));
     return View::make('products.show', $data);
 }
 /**
  * Checks if the parameter is a valid product id
  * @param $id int
  * @return Product object if $id is found, otherwise false
  */
 private function __checkExistence($id)
 {
     if (!is_null($id) && $id != '') {
         $product = Product::withTrashed()->find($id);
         if (is_null($product)) {
             return false;
         }
         return $product;
     }
     return false;
 }