File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/resources/views/crud/fields Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1818 }
1919
2020 // developer can provide the enum class so that we extract the available options from it
21- $enumClassReflection = isset ($field [' enum_class' ]) ? new \ ReflectionEnum ($field [' enum_class' ]) : false ;
21+ $enumClassReflection = isset ($field [' enum_class' ]) ? new \ ReflectionEnum ($field [' enum_class' ]) : false ;
2222
2323 if (! $enumClassReflection ) {
2424 // check for model casting
2727 $enumClassReflection = new \ ReflectionEnum ($possibleEnumCast );
2828 }
2929 }
30-
30+
3131 if ($enumClassReflection ) {
3232 $options = array_map (function ($item ) use ($enumClassReflection ) {
3333 return $enumClassReflection -> isBacked () ? [$item -> getBackingValue () => $item -> name ] : $item -> name ;
3434 },$enumClassReflection -> getCases ());
35- $options = is_multidimensional_array ($options ) ? array_merge (... $options ) : array_combine ($options , $options );
35+ $options = is_multidimensional_array ($options ) ? array_replace (... $options ) : array_combine ($options , $options );
3636 }
3737
3838 if (isset ($field [' enum_function' ]) && isset ($options )) {
5454 $options = $entity_model :: getPossibleEnumValues ($field [' name' ]);
5555 return array_combine ($options , $options );
5656 })();
57-
57+
5858
5959 if (function_exists (' enum_exists' ) && ! empty ($field [' value' ]) && $field [' value' ] instanceof \ UnitEnum ) {
6060 $field [' value' ] = $field [' value' ] instanceof \ BackedEnum ? $field [' value' ]-> value : $field [' value' ]-> name ;
You can’t perform that action at this time.
0 commit comments