Want to use multiple languages with https://github.com/dimsav/laravel-translatable, but don't know how to use laravel-translatable in form method.
@z-song 这个支持吗?
@manzhouya
Example:
$form->tab('Document Type', function (Form $form) {
$form->display('id', trans('columns.id'));
$form->text('name', trans('columns.name_locale', ['locale' => App::getLocale()]));
$form->switch('use_pages', trans('columns.use_pages'));
$form->display('created_at', trans('columns.created_at'));
$form->display('updated_at', trans('columns.updated_at'));
})->tab('Translations', function (Form $form) {
$form->hasMany('translationsexceptcurrent', trans('columns.translations'), function (Form\NestedForm $form) {
$form->text('name', trans('columns.name'));
$form->select('locale', trans('columns.locale'))->options(locale_options());
});
});
in translated model:
public function translationsExceptCurrent() {
return $this->translations()->where('locale', '<>', App::getLocale());
}


@luischavez
I tried it and it succeeded. Thank you!
@luischavez
Do you know any method to pass options for model method with hasMany?
Most helpful comment
@manzhouya
Example:
in translated model: