Merge pull request #14998 from aSeriousDeveloper/text-column-array-support

fix: allow text-columns to read a nested array value
This commit is contained in:
Dan Harrin
2024-12-04 12:32:41 +00:00
committed by GitHub
@@ -43,7 +43,17 @@
$arrayState = implode(
', ',
array_map(
fn ($value) => $value instanceof \Filament\Support\Contracts\HasLabel ? $value->getLabel() : $value,
function ($value) {
if ($value instanceof \Filament\Support\Contracts\HasLabel) {
return $value->getLabel();
}
if (is_array($value)) {
return json_encode($value);
}
return $value;
},
$arrayState,
),
);