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

Default Image::make not working #14

Closed orchie closed 2 years ago

orchie commented 2 years ago

when I tried save, it throw an exception like title. the config file tab-translatable.php is default . 'source' => 'array'

please help~ thanks~

kongulov commented 2 years ago

@orchie You either did not install the package spatie/laravel-translatable or did not configure the model

https://github.com/kongulov/nova-tab-translatable#usage

orchie commented 2 years ago

package

thanks~ this ok. I forgot use Spatie\Translatable\HasTranslations in my Model

and other problems:

NovaTabTranslatable::make([
                Image::make('Img','img'),
                Text::make("Url", 'url')->default("aa"),
            ]),

the default is invalid, if the value is not required and not input the data [url] in database is like this

{"hk": null}

will drop other langs.

and i test img field,upload two langs , but only one saved. data [img] like this

{"en": "UJnTiXQFF6AGWshQUVw8Y8BU0yRv8kpXHM2ug8Z3.jpg"}

thanks~

orchie commented 2 years ago

@kongulov hi, the field "Image" has bugs... like this

package

thanks~ this ok. I forgot use Spatie\Translatable\HasTranslations in my Model

and other problems:

NovaTabTranslatable::make([
                Image::make('Img','img'),
                Text::make("Url", 'url')->default("aa"),
            ]),

the default is invalid, if the value is not required and not input the data [url] in database is like this

{"hk": null}

will drop other langs.

and i test img field,upload two langs , but only one saved. data [img] like this

{"en": "UJnTiXQFF6AGWshQUVw8Y8BU0yRv8kpXHM2ug8Z3.jpg"}

thanks~

kongulov commented 2 years ago

@orchie I have corrected the default value. I am looking for image solutions

kongulov commented 2 years ago

@orchie https://github.com/kongulov/nova-tab-translatable/commit/f163f17da08dda48574a4837e3cb394b7ffc8b84 All is ready. Many changes and additions were made to make the file work.

orchie commented 2 years ago

@kongulov thank you very much!I will try later.

kongulov commented 2 years ago

@orchie After checking, say whether everything is ok or not