Example #1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $products = Product::paginate(30);
     $products->setPath('products');
     return view('catalogs.products.index')->with('products', $products);
 }
 public function show(Request $request)
 {
     $products = Product::paginate(3);
     $products->setPath('/');
     if ($request->ajax()) {
         return Response::json(\View::make('layouts.products')->with(compact('products'))->render());
     }
 }
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('_footer', function ($view) {
         $view->with('pages', \App\Page::all());
     });
     view()->composer('errors.404', function ($view) {
         $view->with('products', \App\Product::paginate(12));
     });
 }
 /**
  * Despliega la lista de productos que se encuentra en nuestra tabla Products
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     /* Obtiene todos los records de nuestra tabla products */
     /* paginate($ int) permite desplegar cierta cantidad de cantidad de productos, en este caso 10 */
     $products = Product::paginate(10);
     /* Indiciamos que el URL a usar para la paginación es products (se espera plazaapp/products/?page=1) */
     $products->setPath('products');
     /* retorna la vista con todos los productos disponibles */
     return view('products.index')->with('products', $products);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $categories = array();
     foreach (Category::all() as $category) {
         $categories[$category->id] = $category->name;
     }
     $products = Product::paginate(5);
     return view('admin.products.index', compact('products'));
     //Regresar la variable categories a la vista con todos los datos
 }
 public function showproducts()
 {
     $brands_mobile = Brand::where('brand_type', 'LIKE', '%phone%')->get();
     $brands_desktop = Brand::where('brand_type', 'LIKE', '%desktop%')->get();
     $brands_laptop = Brand::where('brand_type', 'LIKE', '%laptop%')->get();
     $brands_camera = Brand::where('brand_type', 'LIKE', '%camera%')->get();
     $brands_tv = Brand::where('brand_type', 'LIKE', '%tv%')->get();
     $products = Product::paginate(12);
     $products->setPath('products');
     return view('webcontent/products', compact('products', 'brands_mobile', 'brands_desktop', 'brands_laptop', 'brands_camera', 'brands_tv'));
 }
 public function index()
 {
     $cart = Cart::content();
     $subtotal = Cart::total();
     $shippingfee = $this->shippingfee;
     if (!$subtotal) {
         $shippingfee = 0;
     }
     if ($subtotal > 1150) {
         $shippingfee = 0;
     }
     $taxrate = $this->taxrate;
     $tax = round($subtotal * $taxrate);
     $total = $subtotal + $shippingfee + $tax;
     $products = Product::paginate(3);
     return view('pages.app')->with(compact('cart', 'subtotal', 'tax', 'shippingfee', 'total', 'products'));
 }
Example #8
0
 protected function getPageElements($current, $title, $description, $keywords, $categories = false, $products = false, $promo = false, $currentCategory = null, $perPage = 12)
 {
     $data = ['current' => $current, 'title' => $title, 'description' => $description, 'keywords' => $keywords, 'current_category' => $currentCategory];
     if ($categories) {
         $data['categories'] = App\ProductsCategory::where('parent_id', '=', 0)->get();
     }
     if ($products) {
         $productsResponse = Product::paginate($perPage);
         $products = $productsResponse->getCollection()->all();
         $pages = $productsResponse->render();
         $data['products'] = $products;
         $data['pages'] = $pages;
     }
     if ($promo) {
         $data['promo_products'] = Product::where('on_discount', '<>', 0)->get()->take(3);
     }
     return $data;
 }
 public function showproducts()
 {
     $number_of_items = Cart::content();
     // Lấy các sản phẩm có trong cart
     $brands_mobile = Brand::where('brand_type', 'LIKE', '%phone%')->get();
     // Lấy loại có tên là PHONE
     $brands_desktop = Brand::where('brand_type', 'LIKE', '%desktop%')->get();
     // Tương tự trên
     $brands_laptop = Brand::where('brand_type', 'LIKE', '%laptop%')->get();
     // Tương tự trên
     $brands_camera = Brand::where('brand_type', 'LIKE', '%camera%')->get();
     // Tương tự trên
     $brands_tv = Brand::where('brand_type', 'LIKE', '%tv%')->get();
     // Tương tự trên
     $products = Product::paginate(12);
     // Phân trang, 12 sản phẩm một trang
     $products->setPath('products');
     return view('webcontent/products', compact('products', 'brands_mobile', 'brands_desktop', 'brands_laptop', 'brands_camera', 'brands_tv', 'number_of_items', 'number_of_items'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($page = 5)
 {
     $products = Product::paginate($page);
     return view('cp.products.index', compact('products'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $products = Product::paginate(5);
     return view('products.index', compact('products'));
 }
Example #12
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Model $objects)
 {
     $objects_for_filter = Model::all();
     return view('admin.product.list', ['objects' => $objects->paginate(10), 'objects_for_filter' => $objects_for_filter]);
 }
 /**
  * Method for showing all the products stored in the database.
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $products = Product::paginate(10);
     return view('ecomm.admin.products.index', compact('products'));
 }
Example #14
0
 public function products()
 {
     $products = Product::paginate(9);
     return view('products', array('title' => 'Products Listing', 'description' => '', 'page' => 'products', 'brands' => $this->brands, 'categories' => $this->categories, 'products' => $products));
 }
Example #15
0
 public function produto()
 {
     $products = Product::paginate(16);
     $products->setPath('produtos');
     return view('listaProduto', ['products' => $products]);
 }
 /**
  * Show all categories
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function showAllCategories()
 {
     $products = Product::paginate(35);
     $category = null;
     return view('categories.show', compact('products', 'category'));
 }
Example #17
0
 public function products()
 {
     $product = Product::paginate(15);
     return view('admin.products.index', compact('product'));
 }
 public function showDetail($cid, $pid)
 {
     // echo $id;
     return view('productsDetail')->withCategories(Category::all())->withMenu('menu_selected')->withProduct(Product::find($pid))->withProducts(Product::paginate(1));
 }
 public function getView()
 {
     $products = Product::paginate(10);
     $catos = Category::all();
     return view('a.products')->with('products', $products)->with('catos', $catos)->with('cato', Category::lists('name', 'id'));
 }
Example #20
0
 public function product()
 {
     $data = array('brand' => Brand::all(), 'barang' => Product::paginate(15), 'cart' => Cart::content(), 'total' => Cart::total(), 'download' => Download::limit(3)->offset(0)->get(), 'testimoni' => Testimoni::limit(10)->offset(0)->get());
     return view('front.product', compact('data'));
 }
 /**
  * Display a listing of the resource.
  * @param Request $request
  * @return Response
  * @internal param
  */
 public function index(Request $request)
 {
     $limit = $request->input('limit') ?: 3;
     $products = Product::paginate($limit);
     return $this->respondWithPagination($products, ['data' => $this->productTransformer->transformCollection($products->all())]);
 }
Example #22
0
<?php

Route::get('/', function () {
    $products = \App\Product::paginate(4);
    return view('welcome')->with(compact('products'));
});
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $title = 'View All Product';
     $products = Product::paginate(10);
     return view('private.product.index', compact('title', 'products'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Product::paginate();
 }
 public function getAllProducts()
 {
     $products = Product::paginate(12);
     return view('store.all-product-list')->with('products', $products);
 }
Example #26
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return view('home')->with(['products' => Product::paginate(30)]);
 }
 public function index()
 {
     // return App\Product::all();
     return App\Product::paginate();
 }
Example #28
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $host = MyS3Tool::getS3Path();
     return view('admin/productHome')->withProducts(Product::paginate(8))->withHost($host);
 }
 public function index()
 {
     $products = Product::paginate();
     return view('product/product-list')->with('products', $products);
 }
 /**
  * find all products
  *
  * @return \Illuminate\Database\Eloquent\Collection|static[]
  */
 public function all()
 {
     return Product::paginate(5);
 }