fix: add validation rule while creating panel

This commit is contained in:
RoyHridoy
2025-02-25 16:53:53 +06:00
parent 8a19e7c2e9
commit 529dcd1946
@@ -20,6 +20,10 @@ trait CanGeneratePanels
placeholder: $placeholder,
default: $default,
required: true,
validate: fn (string $value) => match (true) {
preg_match('/^[a-zA-Z].*/', $value) => null,
default => 'The ID must start with an alphabet letter.',
},
));
$class = (string) str($id)