Closed felipevfa closed 2 years ago
@felipevfa
First of all thanks for use the package.
I will test what you comment and fix it if failing.
@felipevfa
I checked what you say and it's not working because our package do deletions with Builder for performance reasons.
Unfortunately observers only work with single Model. I will check if we can fire event on every deleted relation with model and identifiers.
It is very important enhancement
Any news on this matter?
@heikokrebs I started it few days ago but all code must be refactored to fireModelEvent can be called. QueryBuilder executes update and is hard to track delete/restore events.
Any news on this?
@aat2703 Now I do not have time to do it. You are free to do it and create a pull request with needed changes.
Thanks for your interest on package.
Description
The model events (like
deleting
ordeleted
) are not fired during the soft cascade (not sure if this is intended behavior).I want to use Observers to act on the models before they are soft deleted, but they don't get called since the events are not fired.
I am taking steps to upgrade my Laravel version, so if this is already solved (in case it isn't expected behavior) in the package's 5.6 and 5.7, that would be a relief.
Thanks for your time. Awesome package, by the way!
Steps to Reproduce
Create an Observer for a model that is going to be cascade (soft) deleted and then (soft) delete the parent model.
Edit: typo.
Code Example
ModelA.php
ModelB.php
ModelBObserver.php
In
AppServiceProvider.php
In a Test file:
The test fails.