updateAttributes fails! fix methodology

This commit is contained in:
Antonio Ramirez
2017-08-06 15:28:05 +02:00
parent 031e514e2f
commit 026a6e9825

View File

@ -23,17 +23,14 @@ class ResetPasswordService implements ServiceInterface
public function __construct($password, User $model, SecurityHelper $securityHelper)
{
$this->password;
$this->password = $password;
$this->model = $model;
$this->securityHelper = $securityHelper;
}
public function run()
{
return $this->model && (bool)$this->model->updateAttributes(
[
'password_hash' => $this->securityHelper->generatePasswordHash($this->password),
]
);
$this->model->password = $this->password;
return (bool)$this->model->save(false, ['password_hash']);
}
}