Skip to content

I set to_array_always_loads_translations to false, but still the translation is automatically taken in relations. #421

@nekooee

Description

@nekooee

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());

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions