Skip to content

Commit 2728713

Browse files
[6.X] Enum Support for Table Rows (#2042)
Table rows now also support fields that are being casted as Enums
1 parent f2bef90 commit 2728713

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

resources/views/components/row.blade.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
}
4141
4242
$contentClassField = data_get($column, 'contentClassField');
43+
44+
if ($content instanceof \UnitEnum) {
45+
$content = $content instanceof \BackedEnum
46+
? $content->value
47+
: $content->name;
48+
}
49+
4350
$content = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $content ?? '');
4451
$field = data_get($column, 'dataField', data_get($column, 'field'));
4552

0 commit comments

Comments
 (0)