parent
32b639e3eb
commit
1c5f892049
2 changed files with 5 additions and 6 deletions
|
@ -209,7 +209,7 @@ class OptionController extends Controller
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($request->input('action') !== 'delete') {
|
if ($request->input('action') !== 'delete') {
|
||||||
$variable = $repo->update($variable, $request->intersect([
|
$variable = $repo->update($variable, $request->only([
|
||||||
'name', 'description', 'env_variable',
|
'name', 'description', 'env_variable',
|
||||||
'default_value', 'options', 'rules',
|
'default_value', 'options', 'rules',
|
||||||
]));
|
]));
|
||||||
|
|
|
@ -123,12 +123,11 @@ class VariableRepository
|
||||||
$variable = ServiceVariable::findOrFail($id);
|
$variable = ServiceVariable::findOrFail($id);
|
||||||
|
|
||||||
$validator = Validator::make($data, [
|
$validator = Validator::make($data, [
|
||||||
'name' => 'sometimes|required|string|min:1|max:255',
|
'name' => 'required|string|min:1|max:255',
|
||||||
'description' => 'sometimes|nullable|string',
|
'description' => 'nullable|string',
|
||||||
'env_variable' => 'sometimes|required|regex:/^[\w]{1,255}$/',
|
'env_variable' => 'required|regex:/^[\w]{1,255}$/',
|
||||||
'default_value' => 'string',
|
'rules' => 'bail|required|string',
|
||||||
'options' => 'sometimes|required|array',
|
'options' => 'sometimes|required|array',
|
||||||
'rules' => 'bail|sometimes|required|string|min:1',
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Ensure the default value is allowed by the rules provided.
|
// Ensure the default value is allowed by the rules provided.
|
||||||
|
|
Loading…
Add table
Reference in a new issue