I already needed this in a project and what I did was to perform a search before performing soft-delete. In my case it was quiet because only 2 tables had relationship with the one that was being manipulated.
To work with a context where you can have n-related tables, and sometimes tables of plugins or modules that may or may not be active, you can create a class derived from the idea of observable pattern.
Create this class with an array of templates that should be consulted when soft-delete is run. Each template shall be inserted in this class when instantiated/read.
One way for the model to be inserted, in Laravel, is to create a Registry and at the time of registration perform the insertion.
Sorry I do not pass example code because I will not be able to do it at the moment, I hope the idea helps, because Laravel does not have this as standard.
The relationships in the model or at the db level? I confess that I was curious about the behavior of the model in these cases
– gmsantos
In model.... how do I make Laravel identify relationships and not allow deletion, even if it is soft delete.
– Patrick Maciel