-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
ShortURL::max('id') alway integer #297
Conversation
In some versions MySQL ShortURL::max('id') will be a string (like "2") and we will get an error.
Hey @rshkabko! Do you have any steps to reproduce the bug that this is fixing? 🙂 |
Hello! I recorded video for you with error - https://youtu.be/F7pwr2LkPfo I have encountered such problems in the database more than once, so I always tried to solve them forcibly at the model level. |
Thanks for the video, that was really useful! 😄 I'm still pretty confused by what might be causing the ID to be returned as a string. Would it be possible for you to share your |
No problem, but this is a standard config, nothing was changed at all. The only difference is the DB version and the PHP version. Here is what chatGPT say - https://monosnap.com/file/H4Uj7WnU1LY0S6iHJLn4VMJXqB0w9y |
I once made a financial system, where IDs were bank card numbers (ex, 1000000000000001). So, even at the PHP level, these numbers did not pass as a integer, because they went beyond the scope of the int |
Thanks for the config! 🙂 Out of interest, what versions of PHP and Laravel are you using? I've not been able to reproduce this issue using the same MySQL version as what you're running. |
PHP 8.2.5 |
Hey @rshkabko! I still couldn't manage to replicate the issue, but I've merged in a bug fix. I'll get it tagged and released now, and hopefully your issue will be solved 😄 |
Thanks! |
This has now been released as part of v8.1.2 🙂 https://github.com/ash-jc-allen/short-url/releases/tag/v8.1.2 |
In some versions MySQL ShortURL::max('id') will be a string (like "2") and we will get an error.