File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed
src/Filament/Management/Schemas Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -357,22 +357,17 @@ public static function schema(bool $withOptionsRelationship = true): array
357357 Toggle::make ('settings.allow_multiple ' )
358358 ->inline (false )
359359 ->live ()
360- ->label (
361- __ (
362- 'custom-fields::custom-fields.field.form.allow_multiple '
363- )
364- )
365- ->helperText (
366- __ (
367- 'custom-fields::custom-fields.field.form.allow_multiple_help '
368- )
369- )
360+ ->label (__ ('custom-fields::custom-fields.field.form.allow_multiple ' ))
361+ ->helperText (__ ('custom-fields::custom-fields.field.form.allow_multiple_help ' ))
370362 ->visible (
371- fn (
372- Get $ get
373- ): bool => FeatureManager::isEnabled (CustomFieldsFeature::FIELD_MULTI_VALUE ) &&
363+ fn (Get $ get ): bool => FeatureManager::isEnabled (CustomFieldsFeature::FIELD_MULTI_VALUE ) &&
374364 CustomFieldsType::getFieldType ($ get ('type ' ))?->supportsMultiValue === true
375365 )
366+ ->afterStateUpdated (function (Set $ set , bool $ state ): void {
367+ if ($ state ) {
368+ $ set ('settings.max_values ' , 2 );
369+ }
370+ })
376371 ->default (false ),
377372 TextInput::make ('settings.max_values ' )
378373 ->label (
You can’t perform that action at this time.
0 commit comments