Categories
Laravel limit related model?
Two models Author and Article. How to limit author's articles?
Author:find(1)->articles()->limit(10)->offset(10)->get();
Answer the question
In order to leave comments, you need to log in
Author::with(['articles' => function($query){ $query->limit(10); }])->find(1)->limit(10)->offset(10)->get();
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question