diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 02f7b91a..f96f1a97 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -37,10 +37,11 @@ public function check_create($name, $email) // if not found, create a user with $name, $email and random password $user = User::where('name', $name)->where('email', $email)->first(); if (!$user) { + $password = Str::random(8); $user = User::create([ 'name' => $name, 'email' => $email, - 'password' => bcrypt(str_random(8)) + 'password' => bcrypt($password) ]); } return view('users.show', compact('user')); @@ -56,10 +57,11 @@ public function check_update($name, $email) $user->save(); } else { + $password = Str::random(8); $user = User::create([ 'name' => $name, 'email' => $email, - 'password' => bcrypt(str_random(8)) + 'password' => bcrypt($password) ]); } return view('users.show', compact('user'));