Пример #1
0
 public function getNew()
 {
     $pageData = self::getPageElements('new', 'Niew', '', '', true, false, true);
     $pageData['products'] = Product::latest();
     return view('shop', $pageData);
 }
Пример #2
0
 public function list1()
 {
     return Product::latest()->paginate(4);
 }
 public function composerView()
 {
     View()->composer('partial.header', function ($view) {
         $view->with('latest', Product::latest()->first());
     });
 }
Пример #4
0
 public function getHome()
 {
     $products = Product::latest()->paginate(12);
     return view('front.home', compact('categories', 'products'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return Product::latest()->get();
 }
Пример #6
0
 public function index()
 {
     $products = Product::latest('created_at')->paginate(5);
     return View('products.index', compact('products'));
 }