FutureFreak
5 months ago
1256
3
Nova

Code field in resource null-ing invalid json?

Posted 5 months ago by FutureFreak

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?

Please sign in or create an account to participate in this conversation.