diff --git a/src/Core/Models/User.php b/src/Core/Models/User.php index c71e9b126..5822db69f 100755 --- a/src/Core/Models/User.php +++ b/src/Core/Models/User.php @@ -129,12 +129,23 @@ class User extends Model */ public function changePassword($password) { - $this->password = $password ? static::$hasher->make($password) : null; + $this->password = $password; + $this->raise(new UserPasswordWasChanged($this)); return $this; } + /** + * Store the password as a hash. + * + * @param string $value + */ + public function setPasswordAttribute($value) + { + $this->attributes['password'] = $value ? static::$hasher->make($value) : null; + } + /** * Mark all discussions as read by setting the user's read_time. *