0

シンプルなアプリケーション laravel 5.1 を実行しています。ユーザーのパスワードをリセットしたいと考えています。私はそれで問題はありません。

一部のファイルのパスを変更する方法が見つかりませんでした。その中には、トークンへのリンクを含むユーザーのメールに送信されるファイル「password.blade.php」があります。このファイルは Resources / views / email / ルートにある必要があります。

ここに画像の説明を入力

変更しますか: ファイルの名前とパス。? または、送信する別のビューを選択できる場合は?

ありがとう、情報をいただければ幸いです)。

4

1 に答える 1

1

PasswordBroker には $emailView 変数があります。

/**
 * The view of the password reset link e-mail.
 *
 * @var string
 */
protected $emailView;

これを Password Controller のビューに設定すると、そのパスと名前を変更できるはずです。

うまくいかない場合は、パスワード コントローラーの emailResetLink 関数を上書きして、そこでビューを変更できます。これはLaravel 5.2のものです。異なる場合は、PasswordBroker.php から 5.1 を取得できます。

/**
 * Send the password reset link via e-mail.
 *
 * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
 * @param  string  $token
 * @param  \Closure|null  $callback
 * @return int
 */
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->send($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);
        }
    });
}
于 2016-02-11T04:32:55.557 に答える