File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ public static function bootTranslatable(): void
3636 });
3737
3838 static ::deleted (function (Model $ model ) {
39+ /* @var Translatable $model */
3940 if (self ::$ deleteTranslationsCascade === true ) {
4041 return $ model ->deleteTranslations ();
4142 }
@@ -103,9 +104,7 @@ public function deleteTranslations($locales = null): void
103104 $ translations = $ this ->translations ()->whereIn ($ this ->getLocaleKey (), $ locales )->get ();
104105 }
105106
106- foreach ($ translations as $ translation ) {
107- $ translation ->delete ();
108- }
107+ $ translations ->each ->delete ();
109108
110109 // we need to manually "reload" the collection built from the relationship
111110 // otherwise $this->translations()->get() would NOT be the same as $this->translations
You can’t perform that action at this time.
0 commit comments