Open manojhl opened 3 years ago
I have this issue also ... I tried a lot from what you described, but to no success :(
Same problem here. The problem is occurring when I use an Image Field inside A Flexible Field inside the Nova Settings package. If I use in a model, works well. If I save for first time everything works correctly and the images are saved on the disk and in the json field. But If I let empty the Image field with a previous image saved, the field image is removed from the json of the Flexible content, both key and value.
Laravel 11 whitecube/nova-flexible-conten 1.1 outl1ne/nova-settings 5.2
I was trying to use Nova Flexible Content with nova settings.
Nova Flexible Content has a custom cast type which needs to be used in order for it to work properly. I believe this is not supported at this time.
The problem lies with saving the data. Every time the settings are saved any image filed within the flexible model will be set to null unless an image is selected every time.
I tried creating a custom Setting Model but this didn't work as it doesn't follow the Laravel standard casting.
I tried to implement a custom cast case inside getValueAttribute method, but again it didn't work.![image](https://user-images.githubusercontent.com/4166764/101635446-00ca8880-3a50-11eb-9d31-041d9b276ae4.png)
I was hoping you could help me with finding a solution to my problem. I would appreciate any suggestions or direction.
Thanks