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

Error on Resource::translations() #4

Closed JurjenRoels closed 3 years ago

JurjenRoels commented 3 years ago

Hi,

I get this error with a model I set up to be translatable

First I got an error message saying that model::translations() was an undefined method.

So I added to my model:

public function translations($key=null)
{
    return $this->getTranslations($key);
}

Now I am getting:

Call to a member function withoutGlobalScopes() on array

Working with: nova-tab-translatable : 1.0.5 nova: 3.10 spatie/laravel-translatable 4.5.0

I removed all global scopes I had in the project. That makes no difference

Regards Jurjen

kongulov commented 3 years ago

Hi,

Have you added the HasTranslations trait to the model?

JurjenRoels commented 3 years ago

yes, I have.

I figured something out. I have a flexible field, which does not work properly with spatie translatable.

When I take that out of the tabs it works. But then I still get an error for each field translations doesn't exist for each field that is in the nova model

JurjenRoels commented 3 years ago

Item can be closed. issue was with a title that was required. With translatable it is then required on all languages

Errors are because of incompatibility with flexible content

kongulov commented 3 years ago

For the future I will try to make it compatible with this package

JurjenRoels commented 3 years ago

I have requested some information here: https://github.com/whitecube/nova-flexible-content/issues/7#issuecomment-703669714

because it looks like spaties package does not allow it.