Commit f86a8aa6580631df6ff0445616416658deb84154

Authored by Hayk Nazaryan
1 parent 4882dedc8d
Exists in master

fix send email after register

Showing 1 changed file with 5 additions and 7 deletions Side-by-side Diff

app/Http/Controllers/WorkerController.php
... ... @@ -617,13 +617,11 @@ class WorkerController extends Controller
617 617  
618 618 if ($validator->fails()) {
619 619 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
620   - } else {
621   - $user = $this->create($params);
622   - event(new Registered($user));
623   - Auth::guard()->login($user);
624 620 }
625   - if ($user) {
626   - return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
  621 +
  622 + if ($user = $this->create($params)) {
  623 + event(new Registered($user));
  624 + return json_encode(Array("REDIRECT" => redirect()->to('/')->getTargetUrl()));
627 625 } else {
628 626 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
629 627 }
... ... @@ -705,7 +703,7 @@ class WorkerController extends Controller
705 703 'telephone' => $data['telephone'],
706 704 'password' => Hash::make($data['password']),
707 705 'pubpassword' => base64_encode($data['password']),
708   - 'email_verified_at' => Carbon::now(),
  706 +// 'email_verified_at' => Carbon::now(),
709 707 'is_worker' => $data['is_worker'],
710 708 ]);
711 709