Open Cannonb4ll opened 2 years ago
As per discussed, to be able to load in JSON you'll need to do like this:
CodeEditor::make('metadata')->afterStateHydrated(function ($state, $set) { $set('metadata', json_encode($state)); }) ->dehydrateStateUsing(fn ($state) => (array) json_decode($state)) ->required(),
It would be nice if that could be packed up to:
CodeEditor::make('metadata')->json()
As per discussed, to be able to load in JSON you'll need to do like this:
It would be nice if that could be packed up to: