spatie / laravel-translatable

Making Eloquent models translatable

Home Page:https://spatie.be/docs/laravel-translatable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cached model returns plain JSON instead of translation

lasseeee opened this issue · comments

commented

Whenever i cache a model that has translations stored in a JSON column, I get pure JSON back instead of the translated attribute. When i use the getTranslation() method directly instead of relying on the accessor, I get: Call to undefined method stdClass::getTranslation().

Is caching supported? I can't seem to find anything in the docs.

The package does nothing special regarding caching.

If there is something that can be done in the package to solve your problem, please submit a PR with tests.