argument('email'); try { $user = User::where(['email' => $email]) ->first(); } catch (ModelNotFoundException $e) { $this->error('Invalid user ' . $email . '.'); return; } do { $password = $this->secret('Password'); $passwordAgain = $this->secret('Password again'); if ($password !== $passwordAgain) { $this->error('Passwords does not match'); } } while ($passwordAgain !== $password || strlen($password) === 0); // set new password $user->password = Hash::make($password); $user->save(); $this->info('Password successfully changed.'); } }