From 535266db648e2b24fe7911470cd258784a868056 Mon Sep 17 00:00:00 2001 From: lexx Date: Wed, 25 Oct 2023 14:00:22 +0300 Subject: [PATCH] fix text format --- src/Schema/Ui/Slug.php | 2 +- src/Schema/Ui/Text.php | 2 +- src/Schema/Ui/Textarea.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Schema/Ui/Slug.php b/src/Schema/Ui/Slug.php index 9d52134..0522a0f 100644 --- a/src/Schema/Ui/Slug.php +++ b/src/Schema/Ui/Slug.php @@ -32,7 +32,7 @@ class Slug implements FieldInterface, RequiredInterface public function format(array $input, array $output): array { - $value = $input[$this->name] ?? null; + $value = (string)$input[$this->name] ?? null; if(empty($value)){ $value = Str::slug($input[$this->source]); } diff --git a/src/Schema/Ui/Text.php b/src/Schema/Ui/Text.php index 414a94f..9043fb1 100644 --- a/src/Schema/Ui/Text.php +++ b/src/Schema/Ui/Text.php @@ -34,7 +34,7 @@ class Text implements FieldInterface, RequiredInterface public function format(array $input, array $output): array { - $value = $input[$this->name] ?? null; + $value = (string)$input[$this->name] ?? null; $output[$this->name] = (new Nullable($this->nullable, $value, ""))->value(); return $output; } diff --git a/src/Schema/Ui/Textarea.php b/src/Schema/Ui/Textarea.php index f012f62..83de185 100644 --- a/src/Schema/Ui/Textarea.php +++ b/src/Schema/Ui/Textarea.php @@ -31,7 +31,7 @@ class Textarea implements FieldInterface, RequiredInterface public function format(array $input, array $output): array { - $value = $input[$this->name] ?? null; + $value = (string)$input[$this->name] ?? null; $output[$this->name] = (new Nullable($this->nullable, $value, ""))->value(); return $output; }