Skip to content

Commit

Permalink
Merge pull request #14998 from aSeriousDeveloper/text-column-array-su…
Browse files Browse the repository at this point in the history
…pport

fix: allow text-columns to read a nested array value
  • Loading branch information
danharrin authored Dec 4, 2024
2 parents 862fa43 + d51cff6 commit 6f440fe
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/tables/resources/views/columns/text-column.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
);
Expand Down

0 comments on commit 6f440fe

Please sign in to comment.