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

File upload translatable saving on undefined column in database #21

Closed pedramkat closed 2 years ago

pedramkat commented 2 years ago

Hello, I have a problem with uploading file in different languages. In specific i have an 'audio' field where i used to save the url of the uploaded file. now i need it to be translatable:

the method uploadAudio returns a string like {"it":"url","en":"url"}

The issue is that i am getting: Undefined column: 7 ERROR: column \"translations_audio_en\" of relation \"model_name\" does not exist

the column name should be 'audio'. Can you tell what i am doing wrong?

kongulov commented 2 years ago

@pedramkat Hello,

Can you tell me what version of "nova" and "tab translatable" you use?

pedramkat commented 2 years ago

My Nova Version is "3.32.0" And kongulov/nova-tab-translatable => "1.1.1"

pedramkat commented 2 years ago

When i manually put this string "{'it':'path_to_file_it','en':'path_to_file_en'}" in the database under 'audio' column it works. But also the Delete button is not working.

I also noted that the $request->file() is consist of all files being uploaded to the model: array(2) translations_audio_it: Illuminate\Http\UploadedFile translations_audio_en:Illuminate\Http\UploadedFile and there is a loop on ->store function for each of these files where loops over the original array: $request->file() Too many loops