【问题标题】:Reset Password sending me localhost url laravel重置密码向我发送 localhost url laravel
【发布时间】:2018-08-20 08:15:33
【问题描述】:

当我点击重置密码并填写电子邮件并提交时。然后我收到重置电子邮件,但 URL 是本地主机,我的项目在生产服务器上。

在我的配置\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.'));
}

【问题讨论】:

  • 邮件是通过php artisan queue:work/listen发送还是与其余代码同步?
  • 尝试运行 composer dump-autoload
  • 我在服务器php artisan config:clear也做过
  • 我也这样做了 `composer dump-autoload` 但直到 localhost @FullSTack01
  • 非常感谢您的努力,这只是一个小错误。我的问题解决了。 @Quezler

标签: laravel laravel-5


【解决方案1】:

运行以下命令

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

【讨论】:

  • 我已经这样做了,但直到电子邮件中的 localhost URL
  • @KINNARI 你的 app.php 中有 'url' => env('DB_HOST'), 吗?
  • @KINNARI 我在问 app.php
  • muaaaaaaaaaaaaaaah!!!非常感谢。我已经在这件事上花了很多时间
  • 你能看看我的另一个问题吗?
猜你喜欢
  • 1970-01-01
  • 2015-12-25
  • 2018-06-04
  • 1970-01-01
  • 1970-01-01
  • 2014-11-23
  • 2017-08-02
  • 2017-08-31
  • 2016-03-01
相关资源
最近更新 更多