Skip to content

[Bug]: Excluded Attributes disabled with models having softdelete #26

@ElectricMaxxx

Description

@ElectricMaxxx

What happened?

I can not use the excluded attributes with a soft-delete model at the moment.

How to reproduce the bug

When I set a property/attribute to the list of excluded attributes:

public static function excludedFromVersioning(): array
{
    return ['password', 'api_token'];
}

like it is done in your documentation with a Model having:

use Illuminate\Database\Eloquent\SoftDeletes;


use SoftDeletes;

and doing a change like:

$model->fill(['api_token' => 'new value']);
$model->save();

Will create a new version instead of keeping the old one.

Package Version

2.0.0

PHP Version

8.3.0

Laravel Version

10.10

Which operating systems does this happen with?

Linux

Notes

I debugged through your code and the model got ['deleted_at'] => null dirty values in all situations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions