Skip to content

Commit f6020cf

Browse files
authored
fix: error with $label
1 parent 5a9651b commit f6020cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Html/Editor/Fields/Field.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public function className(string $className): static
389389
}
390390

391391
/**
392-
* Add an additional format to indicate if a field is required.
392+
* Add a format to indicate if a field is required.
393393
*
394394
* @return $this
395395
*/
@@ -398,6 +398,6 @@ public function required(bool $required = true): static
398398
$requiredFieldHtml = $required ? '<span class="text-red-500">*</span>' : '';
399399
$label = $this->get('label');
400400

401-
return $this->label($label.' '.$requiredFieldHtml);
401+
return $this->label(($label ?? '').' '.$requiredFieldHtml);
402402
}
403403
}

0 commit comments

Comments
 (0)