我想在Laravel中定製密碼重置電子郵件。定製忘記密碼郵件Laravel 5.4
我不得不覆蓋這個功能:
namespace Illuminate\Auth\Passwords;
use Illuminate\Auth\Notifications\ResetPassword as ResetPasswordNotification;
use Illuminate\Http\Request;
trait CanResetPassword
{
/**
* Get the e-mail address where password reset links are sent.
*
* @return string
*/
public function getEmailForPasswordReset()
{
return $this->email;
}
/**
* Send the password reset notification.
*
* @param string $token
* @return void
*/
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPasswordNotification($token));
}
這是我的嘗試:
public function sendPasswordResetNotification($token, Requests $request)
{
Mail::to($request->email)->send(new newpassword($token));
}
我得到這個錯誤:
Declaration of Illuminate\Foundation\Auth\User::sendPasswordResetNotification($token, Illuminate\Http\Request $request) must be compatible with Illuminate\Contracts\Auth\CanResetPassword::sendPasswordResetNotification($token)
退房這個答案http://stackoverflow.com/questions/40574001/how-to-change-reset-password-email -subject功能於laravel –