diff --git a/packages/admin/src/Support/FieldTypes/Dropdown.php b/packages/admin/src/Support/FieldTypes/Dropdown.php index 38060577a4..b4144dcbe2 100644 --- a/packages/admin/src/Support/FieldTypes/Dropdown.php +++ b/packages/admin/src/Support/FieldTypes/Dropdown.php @@ -21,7 +21,7 @@ public static function getFilamentComponent(Attribute $attribute): Component ) ) ->when(filled($attribute->validation_rules), fn (Select $component) => $component->rules($attribute->validation_rules)) - ->required((bool) $attribute->configuration->get('required')) + ->required((bool) $attribute->required) ->helperText($attribute->translate('description')); } diff --git a/packages/admin/src/Support/FieldTypes/File.php b/packages/admin/src/Support/FieldTypes/File.php index 367bded625..19f4d83881 100644 --- a/packages/admin/src/Support/FieldTypes/File.php +++ b/packages/admin/src/Support/FieldTypes/File.php @@ -15,7 +15,7 @@ public static function getFilamentComponent(Attribute $attribute): Component { return FileUpload::make($attribute->handle) ->when(filled($attribute->validation_rules), fn (FileUpload $component) => $component->rules($attribute->validation_rules)) - ->required((bool) $attribute->configuration->get('required')) + ->required((bool) $attribute->required) ->helperText($attribute->translate('description')); } } diff --git a/packages/admin/src/Support/FieldTypes/ListField.php b/packages/admin/src/Support/FieldTypes/ListField.php index d033dd41f9..c27ec0e078 100644 --- a/packages/admin/src/Support/FieldTypes/ListField.php +++ b/packages/admin/src/Support/FieldTypes/ListField.php @@ -20,7 +20,7 @@ public static function getFilamentComponent(Attribute $attribute): Component return $state; }) ->when(filled($attribute->validation_rules), fn (KeyValue $component) => $component->rules($attribute->validation_rules)) - ->required((bool) $attribute->configuration->get('required')) + ->required((bool) $attribute->required) ->helperText($attribute->translate('description')); } } diff --git a/packages/admin/src/Support/FieldTypes/Number.php b/packages/admin/src/Support/FieldTypes/Number.php index c319471b7f..adb6000528 100644 --- a/packages/admin/src/Support/FieldTypes/Number.php +++ b/packages/admin/src/Support/FieldTypes/Number.php @@ -20,7 +20,7 @@ public static function getFilamentComponent(Attribute $attribute): Component $input = TextInput::make($attribute->handle) ->numeric() ->when(filled($attribute->validation_rules), fn (TextInput $component) => $component->rules($attribute->validation_rules)) - ->required((bool) $attribute->configuration->get('required')) + ->required((bool) $attribute->required) ->helperText($attribute->translate('description')); if ($min) { diff --git a/packages/admin/src/Support/FieldTypes/TextField.php b/packages/admin/src/Support/FieldTypes/TextField.php index 7f5f223794..942cda6ad4 100644 --- a/packages/admin/src/Support/FieldTypes/TextField.php +++ b/packages/admin/src/Support/FieldTypes/TextField.php @@ -26,13 +26,13 @@ public static function getFilamentComponent(Attribute $attribute): Component if ($attribute->configuration->get('richtext')) { return RichEditor::make($attribute->handle) ->when(filled($attribute->validation_rules), fn (RichEditor $component) => $component->rules($attribute->validation_rules)) - ->required((bool) $attribute->configuration->get('required')) + ->required((bool) $attribute->required) ->helperText($attribute->translate('description')); } return TextInput::make($attribute->handle) ->when(filled($attribute->validation_rules), fn (TextInput $component) => $component->rules($attribute->validation_rules)) - ->required((bool) $attribute->configuration->get('required')) + ->required((bool) $attribute->required) ->helperText($attribute->translate('description')); } } diff --git a/packages/admin/src/Support/FieldTypes/Toggle.php b/packages/admin/src/Support/FieldTypes/Toggle.php index a9a40dbc33..74e0c2e09e 100644 --- a/packages/admin/src/Support/FieldTypes/Toggle.php +++ b/packages/admin/src/Support/FieldTypes/Toggle.php @@ -20,6 +20,6 @@ public static function getFilamentComponent(Attribute $attribute): Component ->default(false) ->when(filled($attribute->validation_rules), fn (Toggle $component) => $component->rules($attribute->validation_rules)) ->rule('boolean') - ->required((bool) $attribute->configuration->get('required')); + ->required((bool) $attribute->required); } } diff --git a/packages/admin/src/Support/FieldTypes/TranslatedText.php b/packages/admin/src/Support/FieldTypes/TranslatedText.php index 565f44a5ca..e43e8c19ff 100644 --- a/packages/admin/src/Support/FieldTypes/TranslatedText.php +++ b/packages/admin/src/Support/FieldTypes/TranslatedText.php @@ -21,7 +21,7 @@ public static function getFilamentComponent(Attribute $attribute): Component return TranslatedTextComponent::make($attribute->handle) ->optionRichtext((bool) $attribute->configuration->get('richtext')) ->when(filled($attribute->validation_rules), fn (TranslatedTextComponent $component) => $component->rules($attribute->validation_rules)) - ->required((bool) $attribute->configuration->get('required')) + ->required((bool) $attribute->required) ->helperText($attribute->translate('description')); } } diff --git a/packages/admin/src/Support/FieldTypes/Vimeo.php b/packages/admin/src/Support/FieldTypes/Vimeo.php index 9feb7618a7..ad5795b430 100644 --- a/packages/admin/src/Support/FieldTypes/Vimeo.php +++ b/packages/admin/src/Support/FieldTypes/Vimeo.php @@ -16,7 +16,7 @@ public static function getFilamentComponent(Attribute $attribute): Component return VimeoInput::make($attribute->handle) ->live(debounce: 200) ->when(filled($attribute->validation_rules), fn (VimeoInput $component) => $component->rules($attribute->validation_rules)) - ->required((bool) $attribute->configuration->get('required')) + ->required((bool) $attribute->required) ->helperText( $attribute->translate('description') ?? __('lunarpanel::components.forms.youtube.helperText') ); diff --git a/packages/admin/src/Support/FieldTypes/YouTube.php b/packages/admin/src/Support/FieldTypes/YouTube.php index f7e2449e1b..64ea5fda9c 100644 --- a/packages/admin/src/Support/FieldTypes/YouTube.php +++ b/packages/admin/src/Support/FieldTypes/YouTube.php @@ -16,7 +16,7 @@ public static function getFilamentComponent(Attribute $attribute): Component return YouTubeInput::make($attribute->handle) ->live(debounce: 200) ->when(filled($attribute->validation_rules), fn (YouTubeInput $component) => $component->rules($attribute->validation_rules)) - ->required((bool) $attribute->configuration->get('required')) + ->required((bool) $attribute->required) ->helperText( $attribute->translate('description') ?? __('lunarpanel::components.forms.youtube.helperText') );