The most efficient way would be database query with JOIN, GROUP BY and COUNT. Easier way is something like this: http://stackoverflow.com/questions/24208502/laravel-orderby-relationship-count
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community