How to change base url in laravel?

Member

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

How to change base url in laravel?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by daisha , 10 days ago

@ryleigh 

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:

1
php artisan config:cache


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