Enhance ManualServers functionality: add user-provided information display and credential handling; improve TagsInput validation; update navigation properties

This commit is contained in:
2026-03-13 05:58:51 -04:00
parent 0f36dba867
commit a8b6e5cfba
8 changed files with 951 additions and 19 deletions

View File

@@ -96,19 +96,26 @@ class FilamentInput
->disabled($setting->disabled ?? false)
->hint($setting->hint ?? '')
->hintColor('primary')
->helperText($setting->description ?? '');
->helperText($setting->description ?? '')
->live(onBlur: true);
// For required TagsInput, validate that array has at least one item
// Standard 'required' rule considers empty arrays as valid
// For required TagsInput, add custom validation
if ($setting->required ?? false) {
$input->required()
->rule(function () {
$input->rules([
function () {
return function (string $attribute, $value, \Closure $fail) {
if (!is_array($value) || empty($value)) {
$fail('The :attribute field must have at least 1 items.');
// Check if value is an array and has at least one item
if (!is_array($value)) {
$fail('The :attribute field is required.');
return;
}
if (count($value) === 0) {
$fail('The :attribute field is required.');
return;
}
};
});
}
]);
}
return $input;