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 72c6c70 commit 629a934Copy full SHA for 629a934
src/Traits/Actions.php
@@ -42,8 +42,18 @@ protected function getTranslation(?string $locale = null): ?Model
42
43
$this->hasTranslation($locale);
44
45
- if (isset($this->translations[$locale]))
+ if (isset($this->translations[$locale])) {
46
+ if (is_array($this->translations[$locale])) {
47
+ $item = $this->getTranslatableModel();
48
+ $item = new $item();
49
+ $item->locale = $locale;
50
+ $item->{$this->getTranslatableField()} = $this->getKey();
51
+ $item->fill($this->translations[$locale]);
52
+ $this->addTranslatableWithLocale($locale, $item);
53
+ }
54
+
55
return $this->translations[$locale];
56
57
58
return null;
59
}
0 commit comments