Trigger model events on nested mutation delete of belongsTo relationships#2588
Trigger model events on nested mutation delete of belongsTo relationships#2588skaesdorf wants to merge 6 commits intonuwave:masterfrom
Conversation
|
This would probably also apply to |
|
True, but thats just the case for |
|
Would it be simpler to let Laravel handle the fetching by using |
|
I think thats not possible for |
|
I just stumbled across an edgecase pitfall of
public function verifiedUsers () : BelongsTo
{
return $this->belongsTo( User::class )->onlyVerified();
}... it will not be respected since it is a) lost when calling |
|
@spawnia Any thoughts? I would like to solve this. |
Changes
When deleting a model using a nested belongs to relation, the model will now be queried and then deleted. This ensures model events to be triggered.
Breaking changes
None.