/** * Show the application dashboard to the user. * * @return Response */ public function show(ProductService $productService, $pid) { $product = $productService->getProductById($pid); $favorite = $productService->getFidByUPid($this->user->id, $pid); $product->favorite = $favorite; // dd($product); return view('product.single', ['product' => $product]); }
public static function getFavoriteList(ProductService $productService) { $favorites = array(); $list = $productService->getProducts(); foreach ($list as $product) { $favorite = Favorite::find($product->pid); if (isset($favorite)) { $favorites[$product->fid]['favorite'] = $favorite; } } // dd($favorites); return $favorites; }
/** * @return \Illuminate\Http\RedirectResponse */ public function bulk() { $action = Input::get('action'); $ids = Input::get('public_id') ? Input::get('public_id') : Input::get('ids'); $count = $this->productService->bulk($ids, $action); Session::flash('message', trans('texts.archived_product')); return $this->returnBulk(ENTITY_PRODUCT, $action, $ids); }
/** * @return \Illuminate\Http\RedirectResponse */ public function bulk() { $action = Input::get('bulk_action'); $ids = Input::get('bulk_public_id'); $count = $this->productService->bulk($ids, $action); Session::flash('message', trans('texts.archived_product')); return Redirect::to('settings/' . ACCOUNT_PRODUCTS); }