/** * Display a listing of the resource. * * @return Response */ public function index() { $title = 'CONFIG'; $country = Country::all()->sortBy('country'); $designation = Designation::all()->sortBy('designation'); $city = City::all()->sortBy('city'); $state = State::all()->sortBy('state'); $brands = Brands::all()->sortBy('brand'); $models = Models::all()->sortBy('model'); $businessType = BusinessType::all()->sortBy('name'); return view('myConfig.index', compact('title', 'country', 'designation', 'city', 'state', 'brands', 'models', 'businessType')); }
private function getCategories() { $brands = Brands::all(); return $brands; $consumer_key = 'b64350b6b45c8fed49aa9983bf197844'; $consumer_secret = '85b3ce2964a63c8fb07d868a58f13b69'; $oauth_token = 'd5608ad8dbd007c0d5cd10688e7d428d'; $oauth_secret = '9f11ac72c96ffd96a00ee58cf67b2d2a'; $client = new \OAuth($consumer_key, $consumer_secret, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_AUTHORIZATION); $client->enableDebug(); $client->setToken($oauth_token, $oauth_secret); try { $client->fetch('http://local.giftbig.com/rest/catalog', '', OAUTH_HTTP_METHOD_GET, ['Content-Type' => 'application/json', 'Accept' => '*/*']); $result = $client->getLastResponse(); $result = json_decode($result); return $result->_embedded->products; } catch (\Exception $e) { return []; } }
/** * 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; } }
/** * Display list of brands from storage * @return static */ public function brand() { return Brands::all()->lists('brand', 'brand')->sortBy('brand'); }
public function getBrands() { $brands = Brands::all(); return $brands; }
public function getModels(Request $request) { if (Auth::user()->email == '*****@*****.**') { $brands = Brands::all(); $models = DB::table('models')->where('in_brand', $request->input('brand-id'))->orderBy('position', 'asc')->get(); return view('admin.models')->with('brands', $brands)->with('models', $models); } return redirect('/'); }
public function index() { $brands = Brands::all(); return view('brands.index', ['brands' => $brands]); }
public function searchProducts(Request $request) { $query = $request->input('search-query'); if ($query == '') { return redirect('/'); } if ($request->input('model') == '') { $products = Products::where(DB::raw("name"), 'LIKE', "%{$query}%")->paginate(18); $products->setPath('/search?search-query=' . $query); } else { $products = Products::where(DB::raw("name"), 'LIKE', "%{$query}%")->where('model', $request->input('model'))->paginate(18); $products->setPath('/search?search-query=' . $query . '&model=' . $request->input('model')); } $brands = Brands::all(); $models = Models::all(); $productImages = DB::table('product_images')->get(); $count = 0; // making clearfix for latest products return view('pages.search-results')->with('query', $query)->with('products', $products)->with('query', $query)->with('brands', $brands)->with('models', $models)->with('productImages', $productImages)->with('count', $count); }