Why should you update APP_URL from from http://localhost?

Laravel: Why should you update APP_URL from from http://localhost?

Your site will work fine without updating it - until you start using jobs and commands. When viewed in the browser (such as http://example.com, http://localhost:8000) Laravel can work out what your actual URL is. However, when you start sending emails, running commands and more it won't know what is your actual URL and will revert back to whatever is set in APP_URL (config('app.url')). So make sure you keep it correct, even if it seems to work ok with localhost.

webdevetc profile pic
webdevetc

I am a 29 year old backend web developer from London, mostly focusing on PHP and Laravel lately. This (webdevetc.com) is my blog where I write about some web development topics (PHP, Laravel, Javascript, and some server stuff). contact me here.



More...


Comments and discussion about Why should you update APP_URL from from http://localhost?

Found this interesting? Maybe you want to read some more in this series?

Or see other topics in the Laravel language

Or see other languages/frameworks:
PHP Laravel Composer Apache CentOS and Linux Stuff WordPress General Webdev and Programming Stuff JavaScript
Or see random questions

What are the main error types in PHP

How to set the timezone to UTC in .htaccess

How to set infinite execution time in a PHP script

Remove trailing slash (redirect to remove trailing slash) in .htaccess

How to set up an alias to map one directory to another destination

How can you check if a variable is alphanum (alphanumeric, letters and numbers only) in PHP?

How to set up custom error pages in .htaccess for your Apache server (ErrorDocument)

How to sort an array of dates and times?

How to get the type of a variable in JS?

How to find out which php.ini file PHP is using?