So I want to sort a collection (that's ok for me) but if in this sort result 2 values are equal, I want to compare two other values to determine what goes first.
Ex: I have 30 teams, they all have points, but some teams can have the same number of points. If so, I want to check the victories each team has and put the team with most victories in front of the one with the less.
rankings = $team_stats->sortByDesc(function($product) {
return ($product['nhl_season_w'] * 2) + $product['nhl_season_otl']
});
So yeah! That sorts the team's points, now I want to sort the equalities by victories.
Thanks for the help!
EDIT SOLVED:
I use $key + 1 to make sure my team ID's stays the same so it's easier to use to get anything else from the team ranking :)