Determine if is a soft delete in a event handler Laravel
I have this event handler:
protected static function boot() {
parent::boot();
static::deleting(function($user) { // before delete() method call this
$user->comments()->delete();
});
}
When I use $user->forceDelete(); and $user->delete(); this event is triggered and delete all comments. This is not ok because I want this event to be triggered only on $user->forceDelete();. In my case the other tables does not have soft delete implemented
General question, why is it considered bad practice to use both soft and force delete?
I'm heading that way at the moment with one of my models.
I want to soft delete the item when i'm finished with it (which could be months or years later) and want to preserve all the relations and history with said item.
If I create an item but don't require it before it starts, I want to force delete it along with all it's relations