-
my config: return [
'locales' => [
'en',
'fa',
'ar',
],
'locale_separator' => '-',
'locale' => null,
'use_fallback' => true,
'use_property_fallback' => true,
'fallback_locale' => 'fa',
'translation_model_namespace' => null,
'translation_suffix' => 'Translation',
'locale_key' => 'locale',
'to_array_always_loads_translations' => false,
'rule_factory' => [
'format' => Astrotomic\Translatable\Validation\RuleFactory::FORMAT_ARRAY,
'prefix' => '%',
'suffix' => '%',
],
]; But when I run the following code, translations are also taken in the shipping relation. Why?? $orders = Order::with(['user', 'province', 'city', 'shipping'])->get();
dd($orders->toArray()); |
Beta Was this translation helpful? Give feedback.
Answered by
nekooee
Jul 29, 2024
Replies: 1 comment
-
I understood what the problem was. I had forgotten that I had put this code in one of the middlewares: if (auth()->check() && auth()->user()->admin) {
config(['translatable.to_array_always_loads_translations' => true]);
return $next($request);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Gummibeer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I understood what the problem was. I had forgotten that I had put this code in one of the middlewares: