Skip to content

Commit

Permalink
Fixes #35947 (#35950)
Browse files Browse the repository at this point in the history
This fixes #35947. Since collections can deal with objects then the method sortByMany taken from Arr should be able to deal with objects as well
  • Loading branch information
tm1000 committed Jan 20, 2021
1 parent 208c397 commit fa61b37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Collections/Collection.php
Expand Up @@ -1168,7 +1168,7 @@ protected function sortByMany(array $comparisons = [])
if (is_callable($prop)) {
$result = $prop($a, $b);
} else {
$values = [Arr::get($a, $prop), Arr::get($b, $prop)];
$values = [data_get($a, $prop), data_get($b, $prop)];

if (! $ascending) {
$values = array_reverse($values);
Expand Down

0 comments on commit fa61b37

Please sign in to comment.