-
-
Notifications
You must be signed in to change notification settings - Fork 466
Closed
Labels
questionRequest for support or clarificationRequest for support or clarification
Description
Describe the bug
For some reason using @event directive with @create (and possibly @update) removes all the changes made in the model.
For example if you $model = User::create(...) you can $model->getRawOriginal() and $model->getAttributes() (and other similar functions) to get the original and changed attributes.
This is missing and these 2 functions return the same data and $model->getChanges() is an empty array.
Steps to reproduce
Dispatch an event on @create
createCompany(input: CompanyCreateInput! @spread): Company!
@create
@event(dispatch: "App\\Events\\ModelCreated")
Inside the listener, check the model for changes:
$model->getChanges()
or compare $model->getRawOriginal() and $model->getAttributes()
Metadata
Metadata
Assignees
Labels
questionRequest for support or clarificationRequest for support or clarification