Skip to content

original data in hooks #1707

@ahoyahoy

Description

@ahoyahoy

Environment

latest

Reproduction

playground

Describe the bug

Hi there,

I'm not sure if it is bug.
How to get original data in updating hook?

$getOriginal() works as I expected. After changing .name I can get original name.

In updating hook are model and record args.
Reading model.$getOriginal in this hook return new data.
Second arg record is also new, thus I don't even understand its purpose, when I can get same data with model.$toJson()

So is it bug or how can I get previous data during update proces?

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions