1$collection = collect([5, 3, 1, 2, 4]);
2
3$sorted = $collection->sortDesc();
4
5$sorted->values()->all();
6
7// [5, 4, 3, 2, 1]
1$collection = collect([5, 3, 1, 2, 4]);
2
3$sorted = $collection->sort();
4
5$sorted->values()->all();
6
7// [1, 2, 3, 4, 5]