当我单击“重置密码”并填写电子邮件并提交。.然后我收到重置电子邮件,但URL为localhost,我的项目在生产服务器上。
在我的config \ app.php中:
'url' => env('DB_HOST'),
和
我也尝试这样:'url' => env('APP_URL', 'http://yourtradelog.com'),
这是我的环境。文件
MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=**7
MAIL_USERNAME=apikey
MAIL_PASSWORD=SG.E*****hSbq1IAhFC1tPQg.uFah8Jwtm6GY7lh10wGpA_CPU01ySmAC26HFylz_BFI
MAIL_ENCRYPTION=tls
MAIL_FROM_NAME="Your Trade Log"
MAIL_FROM_ADDRESS=****@yourtradelog.com
这是我的重置...:
public function toMail($notifiable)
{
if (static::$toMailCallback) {
return call_user_func(static::$toMailCallback, $notifiable, $this->token);
}
return (new MailMessage)
->subject(Lang::getFromJson('Reset Password Notification from YourTradeLog.com'))
->line(Lang::getFromJson('You are receiving this email because we received a password reset request for your account.'))
->action(Lang::getFromJson('Reset Password'), url(config('app.url').route('password.reset', $this->token, false)))
->line(Lang::getFromJson('If you did not request a password reset, no further action is required.'));
}
答案 0 :(得分:3)
运行以下命令
php artisan clear-compiled
php artisan cache:clear
php artisan route:clear
php artisan view:clear
php artisan config:clear
也在您的.env
设置APP_URL=http://yourtradelog.com