Closed nathan-io closed 1 year ago
Hi and thank you for bringing this issue out!
We are now using casts defined when calling addSettingsFields
and instead of json serializing it we will let Nova do the logic. Now when you call nova_set_setting_value('retail_sale_products_last_updated', now())
it should work as expected.
Fix is in new 5.2.2 release.
Good luck!
We have a setting which is cast as a
datetime
.When we set the value through Nova, the value is stored in the table as:
However, when setting it via
nova_set_setting_value()
, the result is stored as a string:This causes Nova to throw an exception when viewing the nova-settings page:
However, everything works properly if I chain on
->toISOString()
:Here's our
NovaServiceProvider
:I also found it strange that this format appears to be ISO string (rather than ISO-8601), because Laravel docs say:
Yet that example given looks like ISO, not ISO-8601: