We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5be6d91 commit 586bfaaCopy full SHA for 586bfaa
src/Illuminate/Collections/Collection.php
@@ -576,6 +576,10 @@ public function keyBy($keyBy)
576
foreach ($this->items as $key => $item) {
577
$resolvedKey = $keyBy($item, $key);
578
579
+ if ($resolvedKey instanceof \UnitEnum) {
580
+ $resolvedKey = enum_value($resolvedKey);
581
+ }
582
+
583
if (is_object($resolvedKey)) {
584
$resolvedKey = (string) $resolvedKey;
585
}
0 commit comments