Skip to content

Commit

Permalink
validation rules should be seperated from attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
sevannerse committed Mar 21, 2020
1 parent 307e93c commit 7d03d45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/Http/Requests/Setting/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public function rules()

if ($module->get('settings')) {
foreach ($module->get('settings') as $field) {
if (isset($field['attributes']['required'])) {
$rules[$field['name']] = $field['attributes']['required'];
if (isset($field['rules'])) {
$rules[$field['name']] = $field['rules'];
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions modules/PaypalStandard/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"icon": "fa fa-font",
"attributes": {
"required": "required"
}
},
"rules": "required"
},
{
"type": "textGroup",
Expand All @@ -29,7 +30,8 @@
"icon": "envelope",
"attributes": {
"required": "required"
}
},
"rules": "required"
},
{
"type": "selectGroup",
Expand Down

0 comments on commit 7d03d45

Please sign in to comment.