From 289764c1e3fc3af5d185ac6f4e29e106b030a963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Thu, 27 Apr 2023 16:31:39 +0300 Subject: [PATCH] Change default role name method.. --- app/Jobs/Auth/UpdateRole.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Jobs/Auth/UpdateRole.php b/app/Jobs/Auth/UpdateRole.php index 1248a9697..292f4beae 100644 --- a/app/Jobs/Auth/UpdateRole.php +++ b/app/Jobs/Auth/UpdateRole.php @@ -12,6 +12,10 @@ class UpdateRole extends Job implements ShouldUpdate { public function handle(): Role { + if (in_array($this->model->name, config('roles.defaults', ['admin', 'manager', 'accountant', 'employee']))) { + $this->request->name = $this->model->name; + } + event(new RoleUpdating($this->model, $this->request)); \DB::transaction(function () {