Closed sachindn closed 3 years ago
Hey,
also the other models will use the same locale as all your models.
I think what you mean is that there's a translations
"attribute" if you do toArray()
or toJson()
which contains all translations.
This is the correct behavior. You shouldn't do toArray()
to get an API response. Instead you should use an eloquent API resource class and map your attributes explicitly.
https://laravel.com/docs/8.x/eloquent-resources
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
I have a model User and UserTranslations which are working fine.
I have a relationship from User to UserCertificates Model.
And certificates also have translations to How can I get UserCertificates in default or given locale.
When I am loading $user->certificates it is returning in all locale not in default.
Thanks