Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 1 year 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!

Eventy

Your banner here too?

nonamez nonamez Joined 5 Feb 2015

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.