Answer the question
In order to leave comments, you need to log in
Outputting a bundle of categories with products - how to set a limit on the output?
Good evening!
I ran into this problem - when I output a bunch:
// Получаем товары для блока "Популярные товары"
$products = Category::with('goods_product')->where('siteID', $siteID)->where('type', 1)->where('published', 1)->get();
limit
:public function goods_product()
{
return $this->hasMany('App\Model\Goods', 'category', 'id')->where('published', 1)->limit(8)->with('images');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question