Detag on delete
pierrocknroll opened this issue · 2 comments
pierrocknroll commented
Hello,
It could be great for the database consistency to detag on a deleted model (if it is not soft deleted).
I think you can do something like :
static::deleting(function ($model) {
if (!method_exists($model, 'runSoftDelete') || $model->isForceDeleting()) {
$model->detag();
}
});
Thanks
cviebrock commented
The main idea being that it would help clean up the polymorphic table, right?
I'd be totally open to a PR that did this, if you have time. 😉
pierrocknroll commented
Yeah, ok I'll do it !