Collection de groupe Laravel et trier par la plus grande valeur
//assuming your collection is called $items
$sorted = $items->groupBy('type')
->map(function($group){
return $group->sortByDesc('probability')->take(1);
})
->flatten(1);
SAMER SAEID