public function getNew() { $pageData = self::getPageElements('new', 'Niew', '', '', true, false, true); $pageData['products'] = Product::latest(); return view('shop', $pageData); }
public function list1() { return Product::latest()->paginate(4); }
public function composerView() { View()->composer('partial.header', function ($view) { $view->with('latest', Product::latest()->first()); }); }
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(); }
public function index() { $products = Product::latest('created_at')->paginate(5); return View('products.index', compact('products')); }