Replies: 3 comments
-
If this can be added without too much complexity, I might accept a PR. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, old stuff... but has this ever been implemented? I don't seem to find in the docs and not able to implement it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I've gotten it to work by using attribute casting. My issue is that I'm trying to also get it to work with Nova. Here's my custom accessor/mutator: public function options(): Attribute
{
return new Attribute(function ($value) {
while (is_string($value)) {
$value = json_decode($value, true);
}
return $value;
}, function ($value) {
return json_decode($value);
});
} It basically requires manually decoding the value. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
do you have any plan to support nested fields in json for translatable fields ?
For example I have a field in my database stored as json and representing an array of objects. I wish I could add a simple field.*.label to the translatable attribute of my model instead of simply using a base field.
Thanks in advance for the answer. Since I really need this feature, any hint as to how to implement it would be most welcome, and if the solution we reach seems reliable enough maybe we'll open a PR to share our work.
Beta Was this translation helpful? Give feedback.
All reactions