APP_URL=https://www.yourwebsite.com for production
Laravel: Outsending emails with link from application contains wrong url (localhost) in link
It's my first time uploading a Laravel application to the web. I facilitate Laravel Forge and Digital Ocean. I've made an app where users can register them selves. Upon successful registration, an email with an activation link is sent to the user. The problem arises when the user checks the email. The link contains a link to https://127.0.0.1/...
Internal links in the app works correctly. The link in the mail is made with route('example'), where example is the name of a route made in routes/web.php.
The env.file looks something like:
APP_URL=http://SOME_IP_ADDRESS.
What do I do from here?
In addition, I sent mails to mailtrap. What should I change the mail_host variable to instead in order to send real emails? It looks like:
MAIL_HOST=smtp.mailtrap.io
In advance, thank you.
Please or to participate in this conversation.