Astrotomic / laravel-translatable

A Laravel package for multilingual models
https://docs.astrotomic.info/laravel-translatable/
MIT License
1.24k stars 156 forks source link

How to get translations by default as getTranslationsArray? #358

Closed nekooee closed 1 year ago

nekooee commented 1 year ago

Let's assume that we have taken the translation of a post in this way:

$post = Post::with('translations')->get();

But here I want getTranslationsArray to be returned. Because I have dozens of models that should always be returned this way in any case. Of course, these models are related to admin and have nothing to do with front models. Unfortunately, I did not find any solution. getTranslationsArray, which currently executes an additional query in the provided document, and once translations are taken normally, it is taken again as an array group by locale and imposes an additional task.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days