Hello!
I have a hasOne relationship within a model entitles User
that relates to the Permissions
model. Any time I delete the relationship, a new row is created in the Permissions
table with the previous permissions information, and is unrealted to the current User object.
This created a problem with the response body as well, and forced me to return a findFirst
rather than the calucalted object in the controller. Has anoyone come across this or know of a solution?
In beforeUpdate()
$this->userPermissions->delete()
updateUserAction Controller
return User::findFirstById($user->id)