Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

FutureFreak's avatar

Code field in resource null-ing invalid json?

Is anyone using the Code Nova field type in their Nova resources

e.g. Code::make('Name')->json()

I'm casting the field in the model to json and when I supply valid json - all is good.

However, if the json is invalid (extra comma, or weird quotes) - then the value is saved as null.

Any ideas on how to stop/catch this?

0 likes
3 replies
joxper's avatar

It happens the same to me, I am not sure why, were you able to fix it?

Please or to participate in this conversation.