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

Package does not work with nova filemanager #34

Closed TEstDevelo closed 1 year ago

TEstDevelo commented 1 year ago

Hello. This package is not work with field nova-file-manager: https://novapackages.com/packages/oneduo/nova-file-manager. I get errors: https://imgur.com/a/1dHynwW . We can fix it?

Laravel Nova: 4.0 Nova File Manager: v0.8.3

In model I have get attributes for translation (link on documentation: https://oneduo.github.io/nova-file-manager/installation.html), we need set casts for file fields:

public function getFileAttribute($value): ?AssetObject
{
    if ($value) {
        return new AssetObject('public', $value);
    }

    return null;
}

public function getMobileFileAttribute($value): ?AssetObject
{
    if ($value) {
        return new AssetObject('public', $value);
    }

    return null;
}
kongulov commented 1 year ago

@TEstDevelo This problem is on the side of that package, as it overrides the default save to the database.