How to change base url in laravel?


by ryleigh , in category: PHP Frameworks , 14 days ago

How to change base url in laravel?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer


by daisha , 13 days ago


To change the base URL in Laravel, you can update the APP_URL variable in the .env file located in the root directory of your Laravel project.

  1. Open the .env file in a text editor.
  2. Locate the APP_URL variable and update the URL to the desired base URL.
  3. Save the file and close it.

Now, Laravel will use the new base URL that you have set in the .env file. Remember to clear the cache after making changes to the .env file by running the following command in your terminal:

php artisan config:cache

This will ensure that Laravel picks up the changes you made to the .env file.