How to make pagination with different size for first page? ->paginate(X)

Posted 6 months ago by vladshoob

Hello, dear Laracast community.

Never encountered such problem, but in need to implement this for sake of project.

I have a model Article, as an example.

And on the first page I'd like to present grid 3x4 of cards, but with "load more" card as last. So 11 Article cards and load more card. But for next page I need all 12 article cards.

For now, I make ->paginate(12) and simply hide last one (@if($loop->last) @continue @endif). But hiding is not a valid solution, as I'd like to have all articles to be presented.

If I missed something or not clear, let me know. Thanks in advance for all replies.

Please sign in or create an account to participate in this conversation.