mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Merge pull request #15711 from RoyHridoy/fix/panel-creation-validation
Add Input Validation When Creating Panel
This commit is contained in:
@@ -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 a letter, and not a number or special character.',
|
||||
},
|
||||
));
|
||||
|
||||
$class = (string) str($id)
|
||||
|
||||
Reference in New Issue
Block a user