Laravel config:cache tip
![Laravel config:cache tip](/content/images/size/w2000/2020/07/LARAVEL-tips-and-TRICKS-1.png)
Did you know? If you've cached your laravel configuration files with $ php artisan config:cache
, env()
function calls from everywhere except the config files will return null
.
Loose recommendation: avoid usingenv()
anywhere in your application as this will give you headaches when you're running in production. Only useenv()
inside your configuration files.