I'm trying to add password reset function to my application in Laravel5.4 and the application is able to send an email to the specific address now. But, when I click on the [reset my password] button in the email, it redirects me to /localhost/ Such as http://localhost/password/reset/ , however, my localhost address is 127.0.0.1:8000. In this case, I need to change [localhost] part to [127.0.0.1:8000].
I tried to search app.url in my application, changed all related addresses and keys to 127.0.0.1:8000 and nothing helped.
I have this code in my ResetPassword.php for my button:
->action('Reset Password', url(config('app.url').route('password.reset', $this->token, false)))
So how can I change localhost to any other addresses? Such as 127.0.0.1:8000 in my case.
config('app.url')
is the url configured in your config/app.php
. It is usually read from the APP_URL environment variable in your .env file.
Ref: https://github.com/laravel/laravel/blob/master/config/app.php#L55
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.