We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc63ae1 commit 97a4dbfCopy full SHA for 97a4dbf
src/Translatable.php
@@ -38,7 +38,7 @@ public static function bootTranslatable()
38
{
39
// GET
40
static::retrieved(function (Model $model) {
41
- if (isset($model->translatableAttributes))
+ if (isset($model->translatableAttributes) && $model->relationLoaded('translations'))
42
foreach ($model->translatableAttributes as $attr)
43
$model->setAttribute($attr, $model->translateOrDefault()->{$attr} ?? null);
44
});
0 commit comments