Skip to content

Commit 97a4dbf

Browse files
fix retrieve method
1 parent cc63ae1 commit 97a4dbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Translatable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static function bootTranslatable()
3838
{
3939
// GET
4040
static::retrieved(function (Model $model) {
41-
if (isset($model->translatableAttributes))
41+
if (isset($model->translatableAttributes) && $model->relationLoaded('translations'))
4242
foreach ($model->translatableAttributes as $attr)
4343
$model->setAttribute($attr, $model->translateOrDefault()->{$attr} ?? null);
4444
});

0 commit comments

Comments
 (0)