route()?->parameter('settingName'); if ($routeParam == 'restrictList') { $rule = [ 'value' => [ new IsValidEmailList, ], ]; } else if ($routeParam == 'restrictRule') { $rule = [ 'value' => [ new IsValidRegex, ], ]; } else { $rule = [ 'value' => [ 'required', ], ]; } return $rule; } }