From 51a27bd8189a20bfa541a24736796c92e6e1c571 Mon Sep 17 00:00:00 2001 From: Phyo Thiha Date: Mon, 9 Dec 2024 15:57:47 +0630 Subject: [PATCH 1/3] add permissions array validation rule on store method --- .../Admin/src/Http/Controllers/Settings/RoleController.php | 1 + .../Admin/src/Resources/views/settings/roles/create.blade.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/Webkul/Admin/src/Http/Controllers/Settings/RoleController.php b/packages/Webkul/Admin/src/Http/Controllers/Settings/RoleController.php index 1a208608afd..76f88ee6d36 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Settings/RoleController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Settings/RoleController.php @@ -56,6 +56,7 @@ public function store() 'name' => 'required', 'permission_type' => 'required', 'description' => 'required', + 'permissions' => 'required_unless:permission_type,all', ]); Event::dispatch('user.role.create.before'); diff --git a/packages/Webkul/Admin/src/Resources/views/settings/roles/create.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/roles/create.blade.php index 675308bd48e..488648d46b9 100644 --- a/packages/Webkul/Admin/src/Resources/views/settings/roles/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/roles/create.blade.php @@ -161,7 +161,7 @@ class="primary-button" - +
From 4fba19bbff239c90651db5077d93599cae787f07 Mon Sep 17 00:00:00 2001 From: Phyo Thiha Date: Fri, 13 Dec 2024 12:21:53 +0630 Subject: [PATCH 2/3] handle custom validation --- .../Admin/src/Resources/views/settings/roles/create.blade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/Webkul/Admin/src/Resources/views/settings/roles/create.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/roles/create.blade.php index 488648d46b9..c45a9542d52 100644 --- a/packages/Webkul/Admin/src/Resources/views/settings/roles/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/roles/create.blade.php @@ -161,10 +161,12 @@ class="primary-button" - +
+ + Date: Fri, 13 Dec 2024 14:10:11 +0630 Subject: [PATCH 3/3] change validation rule for permissions column --- .../Admin/src/Http/Controllers/Settings/RoleController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Webkul/Admin/src/Http/Controllers/Settings/RoleController.php b/packages/Webkul/Admin/src/Http/Controllers/Settings/RoleController.php index 76f88ee6d36..185df404603 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Settings/RoleController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Settings/RoleController.php @@ -56,7 +56,7 @@ public function store() 'name' => 'required', 'permission_type' => 'required', 'description' => 'required', - 'permissions' => 'required_unless:permission_type,all', + 'permissions' => 'required', ]); Event::dispatch('user.role.create.before');