Astrotomic / laravel-translatable

A Laravel package for multilingual models

Home Page:https://docs.astrotomic.info/laravel-translatable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get translations by default as getTranslationsArray?

nekooee opened this issue · comments

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.

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