Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This fixes laravel#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 authored Jan 20, 2021
1 parent 208c397 commit b3d45b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Collections/Collection.php
Original file line number Diff line number Diff line change
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 b3d45b4

Please sign in to comment.