From c3605babf95c57e07d4d7b402d5c0a605bbc1f13 Mon Sep 17 00:00:00 2001 From: Misha Griffiths-Prasolova Date: Tue, 30 May 2023 15:59:21 -0500 Subject: [PATCH] fix: fix `sortByCollator` collection macro return keys (monicahq/chandler#556) Fix to `sortByCollator` collection macro Prevents results from being conformed to an object via Inertia rendering --- app/Helpers/CollectionHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Helpers/CollectionHelper.php b/app/Helpers/CollectionHelper.php index 51f46b54ebe..eec5f82b8b8 100644 --- a/app/Helpers/CollectionHelper.php +++ b/app/Helpers/CollectionHelper.php @@ -37,7 +37,7 @@ public static function sortByCollator(Collection $collect, callable|string $call $results[$key] = $collect->get($key); } - return new Collection($results); + return new Collection(array_values($results)); } /**