File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
app/Repositories/ServiceRepository Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public function create($id, array $data)
4848 'name ' => 'required|string|min:1|max:255 ' ,
4949 'description ' => 'required|string ' ,
5050 'env_variable ' => 'required|regex:/^[\w]{1,255}$/ ' ,
51- 'default_value ' => 'required| string|max:255 ' ,
51+ 'default_value ' => 'string|max:255 ' ,
5252 'user_viewable ' => 'sometimes|required|numeric|size:1 ' ,
5353 'user_editable ' => 'sometimes|required|numeric|size:1 ' ,
5454 'required ' => 'sometimes|required|numeric|size:1 ' ,
@@ -59,7 +59,7 @@ public function create($id, array $data)
5959 throw new DisplayValidationException ($ validator ->errors ());
6060 }
6161
62- if (!preg_match ($ data ['regex ' ], $ data ['default_value ' ])) {
62+ if ($ data [ ' default_value ' ] !== '' && !preg_match ($ data ['regex ' ], $ data ['default_value ' ])) {
6363 throw new DisplayException ('The default value you entered cannot violate the regex requirements. ' );
6464 }
6565
You can’t perform that action at this time.
0 commit comments