Skip to content

Resource hook does not provide original attributes. #5629

@stefan-pfeifer

Description

@stefan-pfeifer
  • Laravel Version: 10.10.0
  • Nova Version: 4.24.2
  • PHP Version: 8.2.0

Description:

Expectation:

When the resource hook afterUpdate(NovaRequest $request, Model $model) is called:
$model->original should contain the old values as they were before updating.
$model->attributes should contain the updated values.

Reality:

$model->original contains the updated values, not the original ones.

Workaround:

Use a regular Laravel observer instead of Nova hooks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions