MorphOne mutateRelationshipDataBeforeCreateUsing does not work properly
For some reason, if I use
mutateRelationshipDataBeforeCreateUsing()
the related model gets created with the correct values used in the closure, but Filament runs an update query right after the creation, with the original data inputted. I can also confirm this by using mutateRelationshipDataBeforeSaveUsing(),
because this runs as well and does not have the mutated data from mutateRelationshipDataBeforeCreateUsing()
.
I'm confused, why Filament does behave like this.
It's a problem, because I cannot set my token without getting SQL exceptions, when Filament tries to update it immediately after creation with the wrong value.
Code:
0 Replies