Posts Learn Components Snippets Categories Tags About
/

How to Update App URL in Laravel

Get to know how to update the URL from the config to have a pretty url when generating images, assets path and etc.

Created on Aug 06, 2021

18 views

To change the App URL of a Laravel application, you can specify it from the .env (environment) file. By having the APP_URL updated instead of using the "http://localhost" you will have a pretty URL when generating images, assets path and etc.

APP_NAME="Example App"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=https://example.test

Once you have done that do make sure to clear your config cache or restart your local webserver for the changes to get reflected.
php artisan cache:clear

Snippets by

PostSrc poster

PostSrc

Full stack developer mainly focusing on the front end side of the web. The main author of PostSrc and loves writing tutorial and guides online.

Load comments for How to Update App URL in Laravel

new

PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that's right for your project.

View Components

Other Code Snippets

More