get(); $translationFields = []; foreach ($languages as $language) { $translationFields[] = Textarea::make($language->code) ->label($language->name . " ({$language->code})") ->rows(2); } return $schema ->components([ 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(), ]) ]); } }