toLucky's avatar

Combination of take and paginate

Can someone tell me how to limit the output of a query builder while still useing pagination????

In my controller:

$max_count = 100; $query_builder->get()->take($max_count);

return view('model.index', [ 'model' => $query_builder->paginate(10), ... ]

In my /model/index.blade.php HTML - blah blah {!! $model->render() !!}

Thanks

0 likes
1 reply
jlrdw's avatar

Re-read documentation, it's there.

1 like

Please or to participate in this conversation.