Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Looks like entity's fallback locale is working correctly.
Example scenario;
We have two language support on our website. We are supporting en and tr locales. Fallback locale is tr.
We are switched to en locale and...
If you want to get your entity result in en locale and If your entity record is not have en value, laravel-translatable is using fallback locale and returns tr result of this record. Thats ok. But we can't use fallback locale "automaticly" in where method. We need to use getLocale() function with where method.
Ex
$record = Records::where('slug->'.app()->getLocale()))->first();
If I dont have en result in just one record on the database website is throwing an error. I need to write this code like that;
Am I wrong?
Beta Was this translation helpful? Give feedback.
All reactions