From 29e03ed853866f2f433332eca83ae8a88be04882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= Date: Wed, 30 Oct 2024 10:47:13 +0100 Subject: [PATCH] wip --- src/Fields/Option.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Fields/Option.php b/src/Fields/Option.php index 1e4e987c..3a7c2fa7 100644 --- a/src/Fields/Option.php +++ b/src/Fields/Option.php @@ -4,8 +4,10 @@ use Cone\Root\Traits\HasAttributes; use Cone\Root\Traits\Makeable; +use function Illuminate\Support\enum_value; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Support\Traits\Conditionable; + use JsonSerializable; class Option implements Arrayable, JsonSerializable @@ -25,7 +27,7 @@ class Option implements Arrayable, JsonSerializable public function __construct(mixed $value, string $label) { $this->label = $label; - $this->setAttribute('value', $value); + $this->setAttribute('value', enum_value($value)); $this->selected(false); }