Skip to content

Commit

Permalink
fix saving method
Browse files Browse the repository at this point in the history
  • Loading branch information
MoamenEltouny committed Aug 26, 2021
1 parent 51d3083 commit cc63ae1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Translatable.php
Expand Up @@ -46,14 +46,14 @@ public static function bootTranslatable()
// STORE/UPDATE
static::saving(function (Model $model) {
foreach ($model->translatableAttributes as $attr)
if ($model->{$attr} ?? null) unset($model->{$attr});
unset($model->{$attr});
});

// SAVED
static::saved(function (Model $model) {
$model->saveTranslations();
});

// DESTROY
static::deleting(function (Model $model) {
$model->deleteTranslations();
Expand Down

0 comments on commit cc63ae1

Please sign in to comment.