whitecube / nova-page

Static pages content management for Laravel Nova
https://whitecube.github.io/nova-page
MIT License
238 stars 41 forks source link

Translations not working anymore #55

Open gldrenthe89 opened 4 years ago

gldrenthe89 commented 4 years ago

Argument 2 passed to Spatie\NovaTranslatable\Translatable::Spatie\NovaTranslatable{closure}() must be an instance of Illuminate\Database\Eloquent\Model, instance of App\Nova\Templates\Home given

Using Spatie\NovaTranslatable.

toonvandenbos commented 4 years ago

The error mentions a closure, which one is it ? Is it a closure in Spatie's package or one you defined ?

If it's in Spatie's package, that means they published a release that breaks compatibility with this package. I'd suggest to open an issue on their repository explaining they shouldn't type-hint model classes in fonction arguments for scenarios like these where the package isn't used on models.

gldrenthe89 commented 4 years ago

I have also tried to use the mrmonat/nova-translatable wich gives met the same error.

When i have time i will reproduce both errors from both packages en post them here.

toonvandenbos commented 4 years ago

Both packages use spatie/laravel-translatable, the issue could come from a closure defined in that package.

gldrenthe89 commented 4 years ago

now i there is happening something really weird.

when using mrmonat/nova-translatable the field is stored in the database as expected. But it is not readable in Nova. Also when updating it is getting messed up

"breadcrumb" : [
        "{",
        "\"",
        "d",
        "e",
        "\"",
        ":",
        "\"",
        "t",
        "e",
        "s",
        "t",
        "\"",
        ",",
        "\"",
        "n",
        "l",
        "\"",
        ":",
        "\"",
        "t",
        "e",
        "s",
        "t",
        "\"",
        "}"
    ],
gldrenthe89 commented 4 years ago

i also tried Spatie\NovaTranslatable again and that is giving a different error: Method App\Nova\Templates\TermsPage::setTranslation does not exist.

i understand this message and it doesn;t really bother me because i wanna use the other package noted above