Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.7.15] Breaking change for non int ids that are generated in the database #26683

Closed
zecipriano opened this issue Nov 30, 2018 · 1 comment
Closed
Labels

Comments

@zecipriano
Copy link

Since 5.7.15 (pull request #26622) the id of models, in some situations, is casted to int based only on the $incrementing value, disregarding $keyType.

This causes issues when the model has $keyType = 'string' and $incrementing = true.

In my case, I want to leave $incrementing as true because the id is being generated in the database as a default value (with the function gen_random_uuid()) but I still want Laravel to set the model id after inserting.

Granted, the meaning of 'incrementing' is being subverted to more of a 'being generated in the database', but, as far as I know, there is no other way to instruct Laravel to get the id of the inserted row and update the model with it.

@driesvints
Copy link
Member

@staudenmeir any idea how we could tackle this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants