A bit confused about model events behaving when using SoftDelete trait. Which event will be fired when object will be deleted? forceDeleted?
Asked
Active
Viewed 97 times
2 Answers
1
A quick glance into laravel/framework/src/Illuminate/Database/Eloquent/SoftDeletes.php
shows that SoftDeletes adds two new model events: 'restoring' and 'restored'.
Therefore, you have to listen for the standard events: 'deleting' and 'deleted'. There is no a special 'soft-deleting' kind of event. Also, there are no force deletion events, either.

Denis Mysenko
- 6,366
- 1
- 24
- 33
0
I've figured out how to implement this feature. There are forceDeleting property in SoftDeletes trait. Which indicates are model deleting soft or hard at the moment. So I need only check this property in my event handler.

huuuk
- 4,597
- 2
- 20
- 27