with deleted laravel code example
Example 1: laravel withtrashed
public function category() {
return $this->belongsTo('App\Category')->withTrashed();
}
Example 2: laravel eloquent remove from db
$res=User::where('id',$id)->delete();
public function category() {
return $this->belongsTo('App\Category')->withTrashed();
}
$res=User::where('id',$id)->delete();