/** * Show the application dashboard to the user. * * @return Response */ public function showCheckout() { $market_data = Market::with('category')->get(); if (Auth::check()) { $id = Auth::user()->login_id; $user = User::where('id', $id)->with('member')->get(); return view('client.pages.checkout-address')->with('user', $user)->with('market_data', $market_data); } else { return view('client.pages.checkout-address')->with('market_data', $market_data); } }
public function showCustomerAccount($id, $type) { //if($type=="Info"||$type=="Favorites"||$type=="Wishlist"){ $market_data = Market::with('category')->get(); $city = City::with('area')->get(); if (Auth::check()) { $id = Auth::user()->login_id; $user = User::where('id', $id)->with('member')->get(); return view('client.pages.account-page')->with('user', $user)->with('market_data', $market_data)->with('city', $city)->with('type', $type); } else { return redirect('/Market'); } }
/** * Show the application dashboard to the user. * * @return Response */ public function showProductDetails($pid, $product_name) { if (ProductInfo::where('id', '=', $pid)->where('product_status', '=', '9')->exists()) { $ProductInfo = ProductInfo::with('product')->with('store')->with('productVariantGroup')->with('productVariant')->where('id', '=', $pid)->get(); $fb_seo_meta = array(); foreach ($ProductInfo as $info) { $name = $info->product_name; $store_name = $info->store->store_name; $store_id = $info->store->id; $sub_category_id = $info->sub_category_id; $fb_seo_meta['title'] = $store_name . ' - ' . $info->product_name; $fb_seo_meta['description'] = $info->product_description; foreach ($info->product as $piid) { $product_id = $piid->id; break; } break; } if (ProductInfo::where('id', '=', $pid)->where('product_name', '=', decodeUrlRoute($product_name))->exists()) { $market_data = Market::with('category')->get(); $listFiles = []; $files = \File::files('assets/img/store/' . $store_name . '/product/' . $product_id); foreach ($files as $path) { $listFiles[] = pathinfo($path); } $fb_seo_meta['image'] = 'assets/img/noimage.png'; foreach ($listFiles as $seo_img) { $fb_seo_meta['image'] = $seo_img['dirname'] . '/' . $seo_img['basename']; break; } $store_market_data = Market::with(['category' => function ($query) use($store_id) { $query->whereHas('subCategory', function ($q) use($store_id) { $q->where('store_id', '=', $store_id)->groupBy('category_id'); }); }])->get(); if (Auth::check()) { $id = Auth::user()->login_id; $user = User::where('id', $id)->with('member')->get(); return view('client.pages.product-details')->with('user', $user)->with('market_data', $market_data)->with('store_market_data', $store_market_data)->with('ProductInfo', $ProductInfo)->with('ImageFiles', $listFiles)->with('OtherFiles', $listFiles)->with('fb_seo_meta', $fb_seo_meta); } else { return view('client.pages.product-details')->with('market_data', $market_data)->with('store_market_data', $store_market_data)->with('ProductInfo', $ProductInfo)->with('ImageFiles', $listFiles)->with('OtherFiles', $listFiles)->with('fb_seo_meta', $fb_seo_meta); //return $listFiles; } } else { return redirect('/Product/Details/' . $pid . '/' . encodeUrlRoute($name)); } } else { return redirect('/Market'); } }
private function postAddItemStepOne(ItemRequest $request) { $step = 2; //Get all selected markets with the defaultAttributes foreach ($request->input('markets') as $marketID => $boolean) { if ($boolean) { $selectedMarkets[] = Market::with('defaultAttributes')->where('id', $marketID)->first(); } } //Set <title> $title = 'Add item'; //Set Auth::check() $loggedIn = $this->loggedIn; //Get the markets for the nav and where to place item in $markets = $this->markets; //Return view item/add return view('item.add', compact('title', 'loggedIn', 'markets', 'step', 'selectedMarkets')); }
/** * Show the application dashboard to the user. * * @return Response */ public function showStore($store_id) { $market_data = Market::with('category')->get(); $featured_products = FeaturedProducts::with('product_info')->where('store_id', '=', $store_id)->get(); $store_name = "samplestore"; $store_market_data = Market::with(['category' => function ($query) use($store_id) { $query->whereHas('subCategory', function ($q) use($store_id) { $q->where('store_id', '=', $store_id)->groupBy('category_id'); // here we filter users by the post }); }])->get(); if (Auth::check()) { $id = Auth::user()->login_id; $user = User::where('id', $id)->with('member')->get(); return view('template1.index')->with('user', $user)->with('market_data', $market_data)->with('store_name', $store_name); } else { return view('template1.index')->with('market_data', $market_data)->with('store_market_data', $store_market_data)->with('featured_products', $featured_products)->with('store_name', $store_name); } }
public function render($request, Exception $e) { if ($this->isHttpException($e)) { switch ($e->getStatusCode()) { // not found case 404: $market_data = Market::with('category')->get(); return redirect(\URL::previous())->with('market_data', $market_data); break; // internal error // internal error case '500': $market_data = Market::with('category')->get(); return redirect(\URL::previous())->with('market_data', $market_data); break; default: return $this->renderHttpException($e); break; } } else { return parent::render($request, $e); } }
public function getLogout() { $market_data = Market::with('category')->get(); Auth::logout(); // logout user return redirect(\URL::previous())->with('market_data', $market_data); }
function showMarketCategoryProduct($market, $category, $type) { $market_data = Market::with('categoryStore')->orderBy('id')->get(); $market_data_category = Market::with('category')->where('market_name', '=', $market)->get(); $category = str_replace('-', ' ', $category); if ($market == "Grocery" || $market == "Apparel" || $market == "Gadget" || $market == "Furniture") { $fb_seo_meta = array(); $fb_seo_meta['title'] = 'HomemallPH - ' . $market; $fb_seo_meta['description'] = 'Shop your favorite product and items in our ' . $market . ' market!'; $fb_seo_meta['image'] = 'asset/img/market/' . $market . '.png'; if (Auth::check()) { $id = Auth::user()->login_id; $user = User::where('id', $id)->with('member')->get(); return view('client.pages.market-category-product')->with('user', $user)->with('market', $market)->with('market_data', $market_data)->with('category_name', $category)->with('type', $type)->with('fb_seo_meta', $fb_seo_meta); } else { return view('client.pages.market-category-product')->with('market', $market)->with('market_data', $market_data)->with('category_name', $category)->with('type', $type)->with('fb_seo_meta', $fb_seo_meta); } } else { return redirect(\URL::previous()); } }
public function getLogout() { $loginPath = 'auth/login'; $redirectPath = '/market'; $redirectAfterLogout = 'auth/login'; $market_data = Market::with('category')->get(); Auth::logout(); // logout user return redirect(\URL::previous()); }
function showMarketCategoryProduct($market, $category) { $market_data = Market::with('category')->get(); $category = str_replace('-', ' ', $category); if ($market == "grocery" || $market == "apparel" || $market == "gadget" || $market == "furniture") { if (Auth::check()) { $id = Auth::user()->login_id; $user = User::where('id', $id)->with('member')->get(); return view('client.pages.market-category-product')->with('user', $user)->with('market', $market)->with('market_data', $market_data)->with('category_name', $category); } else { return view('client.pages.market-category-product')->with('market', $market)->with('market_data', $market_data)->with('category_name', $category); } } }