mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
fix: add validation rule while 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 an alphabet letter.',
|
||||
},
|
||||
));
|
||||
|
||||
$class = (string) str($id)
|
||||
|
||||
Reference in New Issue
Block a user