How to cascade soft deletes in Laravel?

Viewed 46

How can I (eloquently) cascade a soft delete in Laravel? So when there is a post with comments for example, where both tables have soft deletes. When I remove the post, I want to remove the comments at well.

I would expect something like:

class Post extends Model
{
    use SoftDeletes;

    protected $cascadeSoftDeletes = ['comments'];

    ...
}
2 Answers
Related