+ /**
+ * Format an array to be stored as a setting.
+ * Array setting types are expected to be a flat array of child key=>value array items.
+ * This filters out any child items that are empty.
+ */
+ protected function formatArrayValue(array $value): string
+ {
+ $values = collect($value)->values()->filter(function (array $item) {
+ return count(array_filter($item)) > 0;
+ });
+
+ return json_encode($values);
+ }
+