-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Updating JSON model with sub JSON objects #16404
Comments
You need to do something like:
|
Thats what Im doing currently, was hoping there would be an easier way is all |
Is there a specific reason why we shouldn't be allowed todo this ? If not I can look at it tonight after my work hours. |
The update method accepts an array of columns with the new values, it's just how it was structured to work :) |
We try to keep this repo for bug reporting only, |
@themsaid acutally
Fails with the same error above, to do it I have todo
This is a JSON castable column , think we were talking about two different things |
If you cast this to JSON, does it work?
|
Re-opening the issue then, will take a deeper look in a few hours and get back to you :) |
Appreciate it~ |
The following example works as expected:
Also works if you try to save a JSON string All this with meta casted to JSON:
|
Another update : I had to upgrade my Laravel Version to 5.3.23 (not my MySQL Version) #16308 fixed for future references |
Laravel Version: v5.3.29 i got a similar problem
SQLSTATE[22018]: Invalid character value for cast specification: 3156 Invalid JSON value for CAST to INTEGER from column json_extract at row 1 (SQL: update |
Description:
When trying to update a JSON casted column , and using sub JSON objects will produce an error
{type: "ErrorException", message: "Array to string conversion",…} file : "/home/vagrant/Code/pm/vendor/laravel/framework/src/Illuminate/Support/Str.php" line : 289 message : "Array to string conversion" type : "ErrorException"
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: