From 7d03d455271e103603398aa699cf0c10f57cbf1f Mon Sep 17 00:00:00 2001 From: Sevan Nerse Date: Sat, 21 Mar 2020 15:34:23 +0300 Subject: [PATCH] validation rules should be seperated from attributes --- app/Http/Requests/Setting/Module.php | 4 ++-- modules/PaypalStandard/module.json | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/Requests/Setting/Module.php b/app/Http/Requests/Setting/Module.php index 82e6108ef..940f8046e 100644 --- a/app/Http/Requests/Setting/Module.php +++ b/app/Http/Requests/Setting/Module.php @@ -29,8 +29,8 @@ class Module extends FormRequest 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']; } } } diff --git a/modules/PaypalStandard/module.json b/modules/PaypalStandard/module.json index ce0827c1d..c633dbd9f 100644 --- a/modules/PaypalStandard/module.json +++ b/modules/PaypalStandard/module.json @@ -20,7 +20,8 @@ "icon": "fa fa-font", "attributes": { "required": "required" - } + }, + "rules": "required" }, { "type": "textGroup", @@ -29,7 +30,8 @@ "icon": "envelope", "attributes": { "required": "required" - } + }, + "rules": "required" }, { "type": "selectGroup",