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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community