I want to display only tags if have articles. Any suggestion how can i do this?
$tags = ATags::with('articles')->whereHas('language',function($query) use($current_language_id) {
$query->where('id','=',$current_language_id)->
})->limit(8)
->get()
->sortByDesc(function($tag) {
return $tag->articles->count();
});
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire