Skip to content

Commit 66c8d26

Browse files
committed
Update TranslationColumn.php
1 parent e52412a commit 66c8d26

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/localization/src/Filament/Tables/Columns/TranslationColumn.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Moox\Localization\Filament\Tables\Columns;
66

77
use Filament\Tables\Columns\TextColumn;
8+
use Moox\Data\Models\StaticLocale;
89

910
class TranslationColumn extends TextColumn
1011
{
@@ -18,6 +19,13 @@ protected function setUp(): void
1819
->sortable()
1920
->toggleable()
2021
->alignCenter()
21-
->searchable();
22+
->searchable()
23+
->state(function ($record) {
24+
return $record->translations->map(function ($translation) {
25+
$locale = StaticLocale::where('locale', $translation->locale)->first();
26+
27+
return $locale?->language_flag_icon ?? 'flag-'.$translation->locale;
28+
})->toArray();
29+
});
2230
}
2331
}

0 commit comments

Comments
 (0)