Don't require a default value
This commit is contained in:
parent
c3d303848c
commit
bea790d149
1 changed files with 2 additions and 2 deletions
|
@ -48,7 +48,7 @@ class Variable
|
|||
'name' => 'required|string|min:1|max:255',
|
||||
'description' => 'required|string',
|
||||
'env_variable' => 'required|regex:/^[\w]{1,255}$/',
|
||||
'default_value' => 'required|string|max:255',
|
||||
'default_value' => 'string|max:255',
|
||||
'user_viewable' => 'sometimes|required|numeric|size:1',
|
||||
'user_editable' => 'sometimes|required|numeric|size:1',
|
||||
'required' => 'sometimes|required|numeric|size:1',
|
||||
|
@ -59,7 +59,7 @@ class Variable
|
|||
throw new DisplayValidationException($validator->errors());
|
||||
}
|
||||
|
||||
if (!preg_match($data['regex'], $data['default_value'])) {
|
||||
if ($data['default_value'] !== '' && !preg_match($data['regex'], $data['default_value'])) {
|
||||
throw new DisplayException('The default value you entered cannot violate the regex requirements.');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue