Esempio n. 1
0
 public function index(Category $category, Product $product)
 {
     //Получаем заглавные категории
     $data['categories'] = $category->getRootCategories();
     //Получаем товары с пометкой "топ"
     $data['products'] = $product->getTopProducts();
     $data['title_for_products'] = 'Топ товары';
     return view('catalog', $data);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $top_products = Model::getTopProducts();
     return view('admin.top-product.list', ['objects' => $top_products, 'brands' => Brand::all()]);
 }