Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 3 months ago.
0

something like this?

Tag::whereIn('id', function($innerQuery){
$innerQuery->select('tag_id')
->from('post_tag')->groupBy('tag_id')->limit(10)->orderBy(DB::raw('count(*)'), 'DESC');
})->get();

I didn't try it

0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

nonamez nonamez nonamez Joined 5 Feb 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.