Category: Laravel

In Laravel online learning resources, the example of joinSub is as follows(https://laravel.com/docs/7.x/queries#joins): The trigger method get() is added in the end. It is very useful for pagination that need groupBy clause. Laravel default pagination cannot include groupBy to get the collection.

It is very simple: just replacing method get() with paginate().

I tested it in both of local and product environments, it works well.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Community Partners