Skip to content

Commit

Permalink
Updates for validations
Browse files Browse the repository at this point in the history
  • Loading branch information
AravindRam-Ranium committed Feb 29, 2024
1 parent 5a52a45 commit 6fcace7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Resources/ConsentOptionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public static function form(Form $form): Form
Repeater::make('fields')->label('')
->schema([
Forms\Components\TextInput::make('name')
->hint('(Ex: some_name)')
->regex('/^[a-z_]+$/')
->required(),
Forms\Components\Select::make('type')
Expand All @@ -118,6 +119,7 @@ public static function form(Form $form): Form
Forms\Components\TextInput::make('label'),
Forms\Components\TagsInput::make('options')->separator(',')->splitKeys(['Tab']),
Forms\Components\Select::make('column_span')
->label('Field\'s Column span')
->options([
1 => '1 Column',
2 => '2 Columns',
Expand All @@ -132,7 +134,9 @@ public static function form(Form $form): Form
->options([
'require_if_another_field' => 'Required If another field matches',
]),
Forms\Components\TextInput::make('another_field')->label('Another field name'),
Forms\Components\TextInput::make('another_field')->regex('/^[a-z_]+$/')
->label('Another field name')
->hint('("Name" of parent)'),
Forms\Components\TextInput::make('value_equals')->label('Value equals'),
])
->visible(fn(Get $get) => (bool)$get('custom_rules'))
Expand Down

0 comments on commit 6fcace7

Please sign in to comment.