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?

>Solution :

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

Leave a Reply