I wasn't aware of that, but come to think of it, I suppose that makes sense. I suppose you could always do a check when displaying the parent to ensure that the child isn't deleted.
Yeah it make sense, but it should be nice that when the "deleted_at" field of the parent is set, that that same field of his child's will also be set when the relation is set "cascade on delete".
Soft deletes doesn't actually delete anything. It just sets a time stamp in the table. Adds some methods so on the parent model query that row will not be set in the query results.
So if you want to cascade to the relationships you will have to actually delete the record or manually delete each relationship. Look at the docs for model events or set a function that will loop through relationships when the delete column is set.
Keep in mind deleting related data on a soft delete defeats the purpose of using soft deleting.
Use model observer to delete the children. You have to iterate over each child if you want them to also fire their deleting observers.
class Parent extends Model
{
public function boot ()
{
parent::boot();
self::deleting(function (Parent $parent) {
foreach ($parent->children as $child) $child->delete();
});
}
}