Laravel自定义电子邮件验证

时间:2020-07-28 17:40:10

标签: laravel

我正在尝试自定义电子邮件验证电子邮件。 在文件\vendor\laravel\framework\src\Illuminate\Auth\Notifications\VerifyEmail.php中 我可以看到以下内容:

    return (new MailMessage)
        ->subject(Lang::get('Verify Email Address'))
        ->line(Lang::get('Please click the button below to verify your email address.'))
        ->action(Lang::get('Verify Email Address'), $verificationUrl)
        ->line(Lang::get('If you did not create an account, no further action is required.'));
}

我的应用程序的语言为nl,到目前为止,我的所有翻译工作正常。 我向\resources\lang\nl添加了一个具有以下内容的messages.php文件:

<?php

return [
    'Verify Email Address' => 'Bevestig uw email adres',
];

但是,发送电子邮件时,主题不会随翻译而改变。 我应该把翻译放在哪里?

1 个答案:

答案 0 :(得分:2)

我找到了解决方案,我必须添加文件\resources\lang\nl\nl.json并添加以下内容:

{
    "Verify Email Address" : "Bevestig uw email adres"
}

现在它可以正常工作了。