Skip to content

SoftDelete behaviour config option true/false #911

Answered by parallels999
dhcmega asked this question in Q&A
Discussion options

You must be logged in to vote

Does it makes sense?

Not much

Did you try transformAudit?

use Illuminate\Database\Eloquent\SoftDeletes;

///
public function transformAudit(array $data): array
{
    if ($this->auditEvent === 'deleted' && in_array(SoftDeletes::class, class_uses(get_class($this)))) {
        $data['old_values'] = [];
        $data['new_values'] = [];
    }

    return $data;
}

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dhcmega
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #909 on March 13, 2024 14:05.