Closed Eyad-Bereh closed 1 year ago
i've figured something out, if I autoload the translation relationship (translation in singular, not in plural) in the model:
protected $with = ["translation"];
I can get the desired result, is there any better way to do this ?
You already got the solution - loading the translation
(singular) relationship.
Greetings ! When I call a translatable entity, all translations get loaded from the database, even those which I don't need them To be more clear, I have a translatable entity that has 2 languages Arabic and English, but when I load the entity in the controller translations for both languages get loaded:
This has a bad impact on performance, I want to only load translations from the currently active locale (either Arabic or English)