Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Clarify env() behavior after config caching #10513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025

Conversation

mohsinaliryk
Copy link
Contributor

Clarify env() behavior after configuration caching The current documentation states that “all calls to the env function will return null” once the configuration has been cached.

However, this is only true for environment variables defined exclusively in the .env file.

If the environment variable exists at the system level (e.g., via putenv(), server configuration, env() will still return a value after caching.

This clarification helps developers understand that env() is not completely disabled after config:cache, but rather depends on the source of the environment variable.

Clarify env() behavior after configuration caching
The current documentation states that “all calls to the env function will return null” once the configuration has been cached.

However, this is only true for environment variables defined exclusively in the .env file.

If the environment variable exists at the system level (e.g., via putenv(), server configuration, env() will still return a value after caching.

This clarification helps developers understand that env() is not completely disabled after config:cache, but rather depends on the source of the environment variable.
@taylorotwell taylorotwell merged commit b398efb into laravel:12.x Jun 18, 2025
@mohsinaliryk mohsinaliryk deleted the patch-1 branch June 18, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.