public function form(Form $form): Form
{
return $form
->schema([
Checkbox::make('allowAllExtensions')
->label(__('templates.allow_all_extensions'))
->live()
->dehydrated(false)
->afterStateUpdated(function (Set $set) {
$set('allowed_file_extensions', ["*"]);
}),
Repeater::make('allowed_file_extensions')
->hidden(fn (Get $get) => $get('allowAllExtensions') === true)
->label(__('templates.allowed_file_extensions'))
->hint(__('templates.allowed_file_extensions_hint'))
->simple(
TextInput::make('extension')
->string()
->regex('/^([a-zA-Z0-9]+)$/u')
->required(),
),
]);
}
public function form(Form $form): Form
{
return $form
->schema([
Checkbox::make('allowAllExtensions')
->label(__('templates.allow_all_extensions'))
->live()
->dehydrated(false)
->afterStateUpdated(function (Set $set) {
$set('allowed_file_extensions', ["*"]);
}),
Repeater::make('allowed_file_extensions')
->hidden(fn (Get $get) => $get('allowAllExtensions') === true)
->label(__('templates.allowed_file_extensions'))
->hint(__('templates.allowed_file_extensions_hint'))
->simple(
TextInput::make('extension')
->string()
->regex('/^([a-zA-Z0-9]+)$/u')
->required(),
),
]);
}