我試圖在laravel上排列密碼重置郵件。Laravel郵件隊列密碼重置
我曾嘗試克隆PasswordBroker如下:如果我改變mailer->queue
到mailer->send
它工作正常
exception 'ErrorException' with message 'Serialization of closure failed: Serialization of closure failed: Serialization of 'Closure' is not allowed'
:
<?php
namespace App;
use Closure;
use Illuminate\Auth\Passwords\PasswordBroker as IlluminatePasswordBroker;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class PasswordBroker extends IlluminatePasswordBroker
{
public function emailResetLink(CanResetPasswordContract $user, $token, Closure $callback = null)
{
// We will use the reminder view that was given to the broker to display the
// password reminder e-mail. We'll pass a "token" variable into the views
// so that it may be displayed for an user to click for password reset.
$view = $this->emailView;
return $this->mailer->queue($view, compact('token', 'user'), function ($m) use ($user, $token, $callback) {
$m->to($user->getEmailForPasswordReset());
if (! is_null($callback)) {
call_user_func($callback, $m, $user, $token);
}
});
}
}
然後我得到這個錯誤。我無法弄清楚發生了什麼事。
這didn't工作...我已經嘗試過... – dante