Closed dsbilling closed 5 years ago
Hi, if you don't want to anonimize relations just don't use gdprAnonymizableFields attribute in the related models, The anonymize function will do the job, looping through all related models, only if gdprAnonymizableFields attribute is not null.
@mgc2222 That throws an error.
As a workaround I did this and nothing more:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Dialect\Gdpr\Anonymizable; <<<<<=====
class ModelName extends Model {
use Anonymizable; <<<<<=====
protected $fillable = [
'field'
];
protected $table = 'modelname';
}
I guess the another solution to this is:
protected $gdprWith = null;
But now everything works without, dont know why I this was a issue in the first place. Closing.
When anonymizing a user it is anonymizing relations, I dont want that. I prefer to delete it with another function. Is there a way to skip that when running anonymize on a user?
I have added $gdprWith relations for the download, but don't need them to anonymize.