From f86a8aa6580631df6ff0445616416658deb84154 Mon Sep 17 00:00:00 2001 From: anazaryan Date: Sat, 23 Nov 2024 17:33:14 +0400 Subject: [PATCH] fix send email after register --- app/Http/Controllers/WorkerController.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index 574e34c..4507a42 100644 --- a/app/Http/Controllers/WorkerController.php +++ b/app/Http/Controllers/WorkerController.php @@ -617,13 +617,11 @@ class WorkerController extends Controller if ($validator->fails()) { return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); - } else { - $user = $this->create($params); - event(new Registered($user)); - Auth::guard()->login($user); } - if ($user) { - return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; + + if ($user = $this->create($params)) { + event(new Registered($user)); + return json_encode(Array("REDIRECT" => redirect()->to('/')->getTargetUrl())); } else { return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); } @@ -705,7 +703,7 @@ class WorkerController extends Controller 'telephone' => $data['telephone'], 'password' => Hash::make($data['password']), 'pubpassword' => base64_encode($data['password']), - 'email_verified_at' => Carbon::now(), +// 'email_verified_at' => Carbon::now(), 'is_worker' => $data['is_worker'], ]); -- 1.7.10.4