Laravel - Configuration and Environment
Which of the following is the correct way to access an environment variable named
APP_NAME in Laravel code?APP_NAME in Laravel code?env() helper function to access variables from the .env file.config() accesses config files, not .env directly. $_ENV and getenv() are PHP ways but not recommended in Laravel.env() helper for .env variables = A [OK]env('VAR_NAME') to get .env values in Laravel [OK]config() instead of env()$_ENV directly15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions