Level 53
@ziben69 well, you would have to paginate each category individually, so eager loading will not work in this case.
@foreach($categories as $category)
<!-- ... -->
@php
$productsPaginator = $category->products()->paginate(3);
<!--you also need to set unique page name, otherwise all paginator instances will load the same page -->
$productsPaginator->setPageName($category->slug . 'Page');
@endphp
@foreach($productsPaginator as $product)
<li><a href="#">{{ $product->title }}</a></li>
@endforeach
{{ $productsPaginator->links() }}
</ul>
</div>
@endforeach