I get all tags and its look like this :
"testeng" => 0
"testeng1" => 5
So what i want to do is order this by value so that first one is this with value 5. 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);
})->get();
$count_tag = [];
foreach($tags as $tag){
$count_tag[$tag->name] = $tag->articles->count();
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire