route('general_config')?->type === GeneralConfigType::engagement) { foreach ([1, 2, 3, 4] as $i) { $rules['data.engagement_' . $i . '_text.value'] = [ 'required', 'string', new WysiwygLength(10, 1500), ]; } } return $rules; } }