Skip to content

Commit

Permalink
Merge pull request #5749 from Laravel-Backpack/fix-enum-column
Browse files Browse the repository at this point in the history
only transform collections in enum column
  • Loading branch information
pxpm authored Jan 16, 2025
2 parents 057c9d9 + 1c2d98a commit b5fdbd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/resources/views/crud/columns/enum.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
$column['value'] = isset($column['enum_function']) ? $enumClass->{$column['enum_function']}() : $column['value'];
}else{
}elseif($column['value'] instanceof \Illuminate\Support\Collection) {
$column['value'] = $column['value']->transform(function($item) use ($column) {
return $item instanceof \BackedEnum ? $item->value : $item->name;
})->toArray();
Expand Down

0 comments on commit b5fdbd3

Please sign in to comment.