From 3ddd86867c1ef481aac1a8e08d95366498a74447 Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Sat, 11 Dec 2021 10:40:24 +0330 Subject: [PATCH] refactor --- app/Containers/AppSection/User/Actions/CreateAdminAction.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Containers/AppSection/User/Actions/CreateAdminAction.php b/app/Containers/AppSection/User/Actions/CreateAdminAction.php index ec8e95992..7f62368fc 100644 --- a/app/Containers/AppSection/User/Actions/CreateAdminAction.php +++ b/app/Containers/AppSection/User/Actions/CreateAdminAction.php @@ -19,9 +19,9 @@ class CreateAdminAction extends Action */ public function run(array $data): User { - DB::beginTransaction(); - try { + DB::beginTransaction(); + $admin = app(CreateUserByCredentialsTask::class)->run($data); app(AssignRolesToUserTask::class)->run($admin, [config('appSection-authorization.admin_role')]); $admin->email_verified_at = now();