mercredi 28 décembre 2016

How to return articles if count is > 0?

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();
  });



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2idQXud
via IFTTT

Aucun commentaire:

Enregistrer un commentaire