getLocale(); return $table ->headerActions([ ImportAction::make() ->importer(SiteTranslationImporter::class), ExportAction::make() ->exporter(SiteTranslationExporter::class) ]) ->columns([ TextColumn::make('key') ->searchable() ->sortable() ->limit(50) ->wrap(), TextColumn::make("translations.{$defaultLocale}") ->label("Translation ({$defaultLocale})") ->searchable() ->limit(50) ->wrap() ->placeholder('No translation'), TextColumn::make('created_at') ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) ->filters([ // ]) ->recordActions([ EditAction::make() ->modalWidth('xl') ->form(function () { $languages = Language::where('is_active', true)->get(); $translationFields = []; foreach ($languages as $language) { $translationFields[] = Textarea::make($language->code) ->label($language->name . " ({$language->code})") ->rows(2); } return [ Section::make() ->schema([ Textarea::make('key') ->label('Key / Original Text') ->required() ->columnSpanFull() ->helperText('The original text to be translated. Use this exact text in t() helper.'), Group::make() ->schema($translationFields) ->statePath('translations') ->columnSpanFull(), ]) ]; }), DeleteAction::make(), ]) ->toolbarActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ]), ]); } }