Example #1
0
 public function getIndex()
 {
     $categories = array();
     foreach (Category::all() as $category) {
         $categories[$category->id] = $category->name;
     }
     return View::make('products.index')->with('products', Product::take(6)->paginate(6))->with('categories', $categories);
 }
 public function Index()
 {
     $top_35_prod = Product::take($_ENV['Product_Number_Home'])->orderBy('id', 'desc')->get();
     $product_img = array();
     foreach ($top_35_prod as $product) {
         //        /$img_url = 'uploads/1443109378.jpg';
         $img_url = $this->image->GetFirstImageUrl($product->id);
         $product_img[$product->id] = $img_url;
     }
     return View::make('home.index')->with('cart', $this->cart)->with('result', $this->result)->with('listBrand', $this->listBrand)->with('user_info', $this->user_info)->with('product_img', $product_img)->with('banner_list', $this->banner_list)->with('website_description', $this->website_description);
 }
 public function getIndex()
 {
     return View::make('store.index')->with('products', Product::take(4)->orderBy('created_at', 'DESC')->get());
 }
 public function getProducts()
 {
     return View::make('store.products')->with('products', Product::take(9)->orderBy('created_at', 'DESC')->get())->with('category');
 }
 public function getIndex()
 {
     $products = Product::take(4)->orderBy('price', 'DESC')->get();
     $products2 = Product::take(4)->orderBy('price', 'ASC')->get();
     return View::make('store.store')->with('products', $products)->with('products2', $products2);
 }