From 2a4b8bed42f95a6f622f36fa49d0f3e2f0be4db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Cmit=20Tun=C3=A7?= Date: Sat, 1 Nov 2025 04:01:00 -0300 Subject: [PATCH] Fix default value assignment in PageForm schema: Updated logic to ensure that when the default value is an array, the first element is used for header data assignment. This change improves data handling and consistency in form population. --- app/Filament/Admin/Resources/Pages/Schemas/PageForm.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Filament/Admin/Resources/Pages/Schemas/PageForm.php b/app/Filament/Admin/Resources/Pages/Schemas/PageForm.php index 216ef9b..1579050 100644 --- a/app/Filament/Admin/Resources/Pages/Schemas/PageForm.php +++ b/app/Filament/Admin/Resources/Pages/Schemas/PageForm.php @@ -573,6 +573,9 @@ class PageForm $existingData[$key] === null || $existingData[$key] === '' || (is_array($existingData[$key]) && empty($existingData[$key]))) { + if(is_array($defaultValue)) { + $defaultValue = reset($defaultValue); + } $set("header_data.{$key}", $defaultValue); } }