-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Can't update models with any flexible field #515
Comments
I want to add to this that it works fine when using sqlite and the error shows on MySql for me. |
I've created a repo which shows the error. There is a dusk TestCase in there which reproduces the error every time. |
Facing the same bug, is there any solution, please? |
I have the same problem. |
I believe the cast just needs to json encode the result. E.g. add this to FlexibleCast or your own Cast that extends FlexibleCast:
|
The above solution is insufficient. You still need to check whether the value is an iterable:
Otherwise, things might start to break in unexpected ways. |
Adding the following to your model file is sufficient:
Replace 'column_name' with your actual column name in the database. |
Thanks for this. |
I've recently upgraded to Laravel 11, and now I can't use FlexFields anymore.
Whenever I'm updating a model with any Flexfield, I get an Exception like this:
I've tried creating the most basic Model copying the docs to see of maybe something else goes wrong:
Model
Resource Fields:
The text was updated successfully, but these errors were encountered: