Strange behaviour env variables since laravel 11 upgrade #54501
Replies: 3 comments 9 replies
-
Could this be an issue of '0' (a string) vs. 0 (an integer)? |
Beta Was this translation helpful? Give feedback.
-
I know they are saying that if you cache your configs, then the env will be empty and you must use any env variable from the config. |
Beta Was this translation helpful? Give feedback.
-
I can be more specific. It is a variable that is used to setup a redis connection.
This is what it says in the config. I have never touched this and it always worked without problems. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I recently upgraded one of my companies applications to Laravel 11 using shift.
Since then we have noticed that the default value of env variables that are defined in a config file are not used.
For example:
env('EXAMPLE_VARIABLE', '0')
I expect that my application uses '0' whenever I don't define it in my environment file. But I have noticed that it doesn't.
I need to explicitly define EXAMPLE_VARIABLE=0 in my env file other wise my application throws errors.
Is this a me problem or has anyone else come across a similar issue?
Beta Was this translation helpful? Give feedback.
All reactions