You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.
I faced a problem that was getting me crazy for a few hours because the error I was getting was somewhat unexpected. And I believe it was caused by efficient-uuid.
My "Organization" table/model has a field called "slug". For some other reason, my trait that should automatically generate the slug value was not working. Anyway, when I was saving my model, I was just doing this:
So, this should fail because "slug" is a required field and it's not being informed anywhere. Something like "slug is a required column and there is no default value" or something like that from the SQL or Laravel. But the error I got was:
So, the problem here is: when the model fails to be saved, I believe that Laravel is trying to convert the binary error with json_encode() and. because of the binary column, another exception is thrown, regarding the bad encoding. Is that anything we could do here? If not, could we update the README file so other users would be aware that this "Malformed UTF-8 characters, possibly incorrectly encoded" may be some missing required fields when saving a model to DB?
I'm also not very sure if this issue should be here or in laravel-model repo.
Cheers.
The text was updated successfully, but these errors were encountered:
I've battled with this issue also. My best solution was to wrap the Eloquent action in a try/catch and decode the error correctly within the catch before outputting it to the JsonResponse.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey.
Thank you for your package. Really nice.
I faced a problem that was getting me crazy for a few hours because the error I was getting was somewhat unexpected. And I believe it was caused by efficient-uuid.
My "Organization" table/model has a field called "slug". For some other reason, my trait that should automatically generate the slug value was not working. Anyway, when I was saving my model, I was just doing this:
So, this should fail because "slug" is a required field and it's not being informed anywhere. Something like "slug is a required column and there is no default value" or something like that from the SQL or Laravel. But the error I got was:
So, the problem here is: when the model fails to be saved, I believe that Laravel is trying to convert the binary error with
json_encode()
and. because of the binary column, another exception is thrown, regarding the bad encoding. Is that anything we could do here? If not, could we update the README file so other users would be aware that this "Malformed UTF-8 characters, possibly incorrectly encoded" may be some missing required fields when saving a model to DB?I'm also not very sure if this issue should be here or in laravel-model repo.
Cheers.
The text was updated successfully, but these errors were encountered: