Skip to content

Commit 155c712

Browse files
authored
Remove translation if empty string given
1 parent af3ba80 commit 155c712

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Eloquent/Traits/Translatable.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ protected static function bootTranslatable()
7272
foreach ($updated_locales as $locale => $value) {
7373
if (strlen(strip_tags(trim($value))) != 0)
7474
$original_locales[$locale] = $value;
75+
76+
if ($value === '') //Remove translation if empty string given
77+
unset($original_locales[$locale]);
7578
}
7679
//remove empty translations from array and save as json
7780
$translations = array_filter($original_locales, function($var) {

0 commit comments

Comments
 (0)