From 73341d9c84ae0c3b2e17d21f0a52916f4d896393 Mon Sep 17 00:00:00 2001 From: LaHiRu Date: Wed, 19 Jun 2024 10:36:01 +0530 Subject: [PATCH] Date field default value --- src/Http/Controllers/SettingsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http/Controllers/SettingsController.php b/src/Http/Controllers/SettingsController.php index c35a068..31d4b1e 100644 --- a/src/Http/Controllers/SettingsController.php +++ b/src/Http/Controllers/SettingsController.php @@ -120,10 +120,10 @@ private function resolvePanel(Panel $panel, $values) { return collect($panel->data) ->each(function (Field $field) use ($values) { - $value = $values[$field->attribute] ?? ''; + $value = $values[$field->attribute] ?? null; if ($field->component == 'date-field') { - $value = Date::parse($value); + $value = $value ? Date::parse($value) : null; } $field->resolve($this->makeFakeResource($field->attribute, $value)); })