kongulov / nova-tab-translatable

This package contains a NovaTabTranslatable class you can use to make any Nova field type translatable with tabs.
MIT License
79 stars 17 forks source link

Using resolveUsing option in fields #28

Open aghayeff opened 1 year ago

aghayeff commented 1 year ago

Nova version: 4.16 Laravel version: 9 Php version: 8.0

Thanks for the great package.

I would like to see some features of Nova inside NovaTabTranslatable. Let's assume that I do not use the trait TranslatableTabToRowTrait and want to filter the texts for all languages using resolveUsing. Something like this:

        NovaTabTranslatable::make([
            Text::make('Title')
                ->resolveUsing(function ($value) {
                    return Str::limit($value, 30);
                })
                ->rules('required_lang:en', 'max:255'),
        ]),

According to the documentation of Nova, resolveUsing should work with Text field.

Thanks in advance.