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.