【发布时间】:2021-03-09 13:34:13
【问题描述】:
我一直在努力重置密码,但使用自定义通知而不是 Laravel 通知。这是文件vendor\laravel\framework\src\Illuminate\Auth\Passwords\CanResetPassword.php
public function sendPasswordResetNotification($token)
{
//use custom notification to change the url instead of modifying the original class
//$this->notify(new ResetPasswordNotification($token));
$this->notify(new CustomResetPassword($token));
}
这就是我在服务类中调用它
$reset_password_status = Password::reset($credentials, function ($user, $password) {
$user->password = $password;
$user->save();
});
if ($reset_password_status == Password::INVALID_TOKEN) {
return $this->returnError->error("Invalid token provided");
}
但问题是在线构建项目是自动完成的,并且每次都运行 composer install 并且不能手动上传更改,所以我正在寻找一种方法来在我的代码中覆盖此功能以重置密码而不是编辑存在于供应商文件夹中的CanResetPassword.php 文件
【问题讨论】: