Laravel Password reset link is pointing to old APP_URL - laravel

I have a Laravel 8 project which is using Laravel/UI for auth.
I changed the APP_URL in the .env file from the test domain extension to IP Address. But the password reset email is showing a link with the previous APP_URL as the base URL.
The following are steps that I have tried to solve this:
Change APP_URL in .env file
Change URL in config/app.php to the IP address instead of env variable.
Ran php artisan config:clear
Ran php artisan cache:clear
Ran php artisan optimize:clear
How can I solve this?

Try running these commands:
php artisan config:cache
php artisan queue:restart

The issue was with url from where I was submitting the form. Laravel/UI reset password uses route() method to get the url for the password reset. Hence why the change in APP_URL and url variable didn't affect the link. A detailed explanation is available here

Related

APP_URL not refreshing after a change

I'm building a Laravel 9 app using Docker.
I'm just starting, so I merely updated the APP_URL variable in the .env (from "http://localhost" to "http://mydomain.local").
After this, I ran the following commands:
php artisan cache:clear
php artisan config:clear
php artisan route:clear
composer dump-autoload
and I restarted the Docker container of the app.
Yet, when I access http://mydomain.local in my browser, the app doesn't load. It still loads properly when I user http://localhost as originally configured.
What am I missing?
This is because you probably didnt edit the vhost..
Just changing the APP_URL in the .env file doesnt change how the browser resolves a domain name.
See this thread to learn how to edit a vhost file: WAMP Server virtual hosts configuration

I have removed a route from web.php and this route still working in laravel 5

I am working in laravel 5 an existing project downloaded from cpanel. I want to make some changes but my changes do not have any affect. I, at the end remove the route but route still working. There is no any extra route file binding in routeServiceProvider not required or included in web.php. I am wondering how it could be happened?
I have tried:
php aritsan cache:clear
php artisan config:clear
can somebody please tell me what could be the issue ?
please run the following:
php artisan route:cache
After running this command, your cached routes file will be loaded on every request.
Please, run the following command:
php artisan route:clear

Laravel 5 change password reset link

In the application files, I did not find a blade for this letter. How can I change the link to a normal address, not a localhost?
Actually laravel generates the password reset url from the .env file. So you have to change your APP_URL in the .env file to your website url or whatever address you have. And then run these commands:
php artisan cache:clear
php artisan config:cache

Can't change MAIL_DRIVER to mailgun in Laravel 5.4

I changed MAIL_DRIVER in .env file of production server like that:
MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAILGUN_DOMAIN=mg.xx.com
MAILGUN_SECRET=key-xx
MAIL_ENCRYPTION=null
I run these commands also:
php artisan config:clear
php artisan config:cache
However, they did not change MAIL_DRIVER. Server continues to send mail via old MAIL_DRIVER. I got from controller env("MAIL_DRIVER"), and it gets nothing (NULL).
How can I solve this problem.
You will need to restart your server and/or just re run php artisan serve on local dev.

Lumen php artisan config:cache not found

I'm trying out the PHP micro Framework Lumen (from laravel).
When I set up Lumen and I try to use the php artisan config:cache command like in Laravel, I get this error :
[InvalidArgumentException]
There are no commands defined in the "config" namespace.
So I have problem when I try to deploy the files to server, so I have to change .env file to change the database username and password.
This makes me think config is not available in artisan
How can I add it to artisan ?
Yes, you can not use the php artisan config:cache with your Lumen project, because it is not available out of the box.
You can add it by adding this package (orumad/lumen-config-cache) to your project:
composer require orumad/lumen-config-cache
In lumen you have to add this configuration in bootstrap/app.php file
$app->configure('custom_config_file_name');
#example
$app->configure('custom_emails');
Then you can access like below:
config('filename.key_name');
#example
config('constants.email');
Lumen no need to config:cache.
You do not need to do anything after change ‍‍.env

Resources