From fa61b374655f465793feb29a49fbeec9c7878081 Mon Sep 17 00:00:00 2001 From: Andrew Nagy Date: Wed, 20 Jan 2021 06:16:15 -0800 Subject: [PATCH] Fixes #35947 (#35950) 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 --- src/Illuminate/Collections/Collection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Collections/Collection.php b/src/Illuminate/Collections/Collection.php index e4549d03ed11..beaac46fe280 100644 --- a/src/Illuminate/Collections/Collection.php +++ b/src/Illuminate/Collections/Collection.php @@ -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);