Askedio / laravel-soft-cascade

Cascade Delete & Restore when using Laravel SoftDeletes
https://medium.com/asked-io/cascading-softdeletes-with-laravel-5-a1a9335a5b4d
MIT License
705 stars 63 forks source link

it is not performing #87

Closed prokarm19 closed 5 years ago

prokarm19 commented 6 years ago

thank you beforehand ! i have defined all the process which you have told but still it is not cascading the softdelete i have parent model <?php

namespace App;

use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use \Askedio\SoftCascade\Traits\SoftCascadeTrait;

class File extends Model { use SoftDeletes; protected $primaryKey = 'F_id'; protected $dates = ['deleted_at']; protected $softCascade = ['entries','Countries'];

public function entries(){ return $this->hasMany('App\Range'); }

public function Countries(){ return $this->hasMany('App\Country'); } }

the child model are::

use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use \Askedio\SoftCascade\Traits\SoftCascadeTrait;

class Range extends Model { use SoftDeletes; protected $primaryKey = 'Per_id'; protected $dates = ['deleted_at']; protected $softCascade = ['prihscodes'];

public function file(){
  return $this->belongsTo('App\File','pri_file_F_id');
}

public function prihscodes(){
  return $this->hasMany('App\Hscode');
}

}

public function principleTrash($id){ $delete_file= File::find($id); $delete_file->where('F_id',$id)->first()->delete(); return redirect()->back(); }

maguilar92 commented 6 years ago

@prokarm19 Please send the issue formated well. Please add this information:

Description:

Steps To Reproduce:

maguilar92 commented 5 years ago

@prokarm19 Due to the time that has passed without receiving an answer, I proceed to close the issue. In case it keeps happening you can reopen it at any time with the information we request.