php - Laravel 5.8 电子邮件验证链接或 APP_URL 部署到服务器后返回 localhost
问题描述
我已经在我的 Laravel 5.8 中配置了 .env 和 config/app.php 中的所有内容,以便在 heroku 中进行生产准备,如下所示:
APP_NAME=Laraclass
APP_ENV=production
APP_KEY=xxx
APP_DEBUG=true
APP_URL=http://larafresh.herokuapp.com
然后我尝试创建一个帐户并检查我的电子邮件验证功能,并且电子邮件中的验证链接或 APP_URL 返回http://localhost:8000,我尝试重新启动我的应用程序,并清除配置但仍然卡住在这里。我不知道这里发生了什么,因为在我创建的另一个链接(电子邮件功能之外)上,它返回到我设置的 APP_URL。
解决方案
如果您首先在服务器中,请不要尝试这个公认的答案。更改 .env 文件中的 APP_URL 取决于严重的问题。
- 如果您在本地机器上并且不使用队列。
php artisan config:clear
php artisan cache:clear
composer dump-autoload
php artisan view:clear
php artisan route:clear
这足以改变您的本地机器。 - 如果您在本地机器上并使用队列。
php artisan config:clear
php artisan cache:clear
composer dump-autoload
php artisan view:clear
php artisan route:clear
此外,您必须重新启动队列php artisan queue:restart
php artisan queue:work
- 如果您在服务器中并使用队列。
php artisan config:clear
php artisan cache:clear
composer dump-autoload
php artisan view:clear
php artisan route:clear
此外,您必须重新启动您的supervisor
sudo supervisorctl restart all
推荐阅读
- c# - 如何使用 UnityEngine.TextEditor 类?没有文件
- c# - 如何根据从先前表单继承的参数使用 SQL 查询填充 WinForm 字段?
- r - - 如何排除列中的条件重复?
- typescript - 触发 dockerhub 存储库时出现映像构建错误,但在本地构建没有问题
- kubernetes - 网络策略是否应用于服务或端点?
- java - 如何在 Swing 中使用 GridLayout?
- recaptcha - 与 recaptcha-v2 复选框相比,谷歌 invisible-recaptcha 是否安全?
- python - 嵌套字典与非嵌套字典的性能如何?(Python)
- machine-learning - 我想使用变量 A 的描述性文本并将它们与变量 B 的描述性文本相关联来预测 B。我该怎么做?
- java - 为什么将图像文件从 python 客户端传输到 java 服务器后无法传输字符串?