Answers for "is cacade work on soft delete in laravel"

PHP
1

is cacade work on soft delete in laravel

put this code in model:

protected static function boot() {
    parent::boot();

    static::deleting(function($offer) {
        $offer->services()->delete();
    });
}

And added missing
  
 use SoftDeletes;
protected $dates = ['deleted_at'];
Posted by: Guest on July-25-2021

Browse Popular Code Answers by Language