Skip to content

Commit

Permalink
Merge pull request #1515 from suraj-webkul/activity-deletintg-method-…
Browse files Browse the repository at this point in the history
…added

activity deleting method added to activity trait's modal.
  • Loading branch information
jitendra-webkul authored Aug 28, 2024
2 parents 9fde0de + 01ee91b commit 0fdedd5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/Webkul/Activity/src/Traits/LogsActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ protected static function booted(): void

self::logActivity($model);
});

static::deleting(function ($model) {
if (! method_exists($model->entity ?? $model, 'activities')) {
return;
}

$model->activities()->delete();
});
}

/**
Expand Down

0 comments on commit 0fdedd5

Please sign in to comment.