fix text format

This commit is contained in:
2023-10-25 14:00:22 +03:00
parent 986c5a4f17
commit 535266db64
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ class Slug implements FieldInterface, RequiredInterface
public function format(array $input, array $output): array public function format(array $input, array $output): array
{ {
$value = $input[$this->name] ?? null; $value = (string)$input[$this->name] ?? null;
if(empty($value)){ if(empty($value)){
$value = Str::slug($input[$this->source]); $value = Str::slug($input[$this->source]);
} }
+1 -1
View File
@@ -34,7 +34,7 @@ class Text implements FieldInterface, RequiredInterface
public function format(array $input, array $output): array 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(); $output[$this->name] = (new Nullable($this->nullable, $value, ""))->value();
return $output; return $output;
} }
+1 -1
View File
@@ -31,7 +31,7 @@ class Textarea implements FieldInterface, RequiredInterface
public function format(array $input, array $output): array 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(); $output[$this->name] = (new Nullable($this->nullable, $value, ""))->value();
return $output; return $output;
} }