/**
  * 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);
     }
 }
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function showMarket()
 {
     $fb_seo_meta = array();
     $fb_seo_meta['title'] = 'HomemallPH';
     $fb_seo_meta['description'] = 'HomemallPH - Convenience at your doorstep!';
     $fb_seo_meta['image'] = 'asset/img/homemalllogo.jpg';
     $market_data = Market::with('categoryStore')->orderBy('id')->get();
     $featured_products = FeaturedProducts::with('product_info')->where('store_id', '=', '0')->get();
     $featured_store = FeaturedStore::with('store')->get();
     $featured_category = FeaturedCategory::with('categoryProduct')->with('category')->get();
     $featured_trend = FeaturedTrend::with('product_info')->get();
     $brands = Brands::all();
     if (Auth::check()) {
         $id = Auth::user()->login_id;
         $user = User::where('id', $id)->with('member')->get();
         return view('client.pages.market')->with('user', $user)->with('market_data', $market_data)->with('brands_data', $brands)->with('featured_products', $featured_products)->with('featured_store', $featured_store)->with('featured_category', $featured_category)->with('featured_trend', $featured_trend)->with('fb_seo_meta', $fb_seo_meta);
     } else {
         return view('client.pages.market')->with('market_data', $market_data)->with('brands_data', $brands)->with('featured_products', $featured_products)->with('featured_store', $featured_store)->with('featured_category', $featured_category)->with('featured_trend', $featured_trend)->with('fb_seo_meta', $fb_seo_meta);
         //return $items;
     }
 }