Laravel Config Cache Not Updating in VSCode Terminal #56351
Replies: 4 comments
-
File: tests/Foundation/FoundationConfigCacheTest.php Add this test case:
|
Beta Was this translation helpful? Give feedback.
-
@mr-kamlesh-pawar where should i add it and why should i add it cos when i check in bootsrap folder i see the cache still has old envs as long as i use the vscode terminal to clear cache |
Beta Was this translation helpful? Give feedback.
-
@bloodykheeng Use the command palette (Ctrl+Shift+P) and run "Reload Window" Try the VSCode PowerShell terminal instead of the default one Clear cache manually: php artisan cache:clear
The test case proposed earlier was meant to help reproduce the issue, but the root cause is likely VSCode's terminal environment isolation. The workaround of using an external terminal is valid until Microsoft fixes this in VSCode. |
Beta Was this translation helpful? Give feedback.
-
Seems to be an issue with VSCode instead a bug in the framework/app. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
11.0
PHP Version
8.2.12
Database Driver & Version
No response
Description
Laravel Config Cache Not Updating in VSCode Terminal
Description
I've encountered an issue where Laravel's mail configuration cache doesn't update properly when using the VSCode integrated terminal, but works correctly when using Windows Command Prompt or PowerShell opened through Windows Search.
Problem
When I modify mail configurations in my
.env
file and run the standard Laravel config cache commands in VSCode's integrated terminal:The cache appears to clear (bootstrap/cache gets cleared), but when I run:
The old configurations are still showing - the new configs from my
.env
file are not being cached.Workaround
The issue is resolved when I use Windows Command Prompt or PowerShell opened directly through Windows Search instead of VSCode's integrated terminal:
After running these commands in the external terminal, both VSCode terminal and the external terminal show the updated mail configurations when running
php artisan config:show mail
.Environment
Expected Behavior
Config cache commands should work consistently regardless of which terminal is used.
Actual Behavior
VSCode terminal fails to properly update the config cache with new environment variables, while external Windows terminals work correctly.
Possible Causes
This might be related to:
Impact
This issue can cause confusion during development and may lead to testing with incorrect configurations when using VSCode's integrated terminal.
Steps To Reproduce
Steps to Reproduce
.env
filephp artisan config:clear
in VSCode terminalphp artisan config:cache
in VSCode terminalphp artisan config:show mail
- observe old configs still cachedphp artisan config:show mail
in both terminals - observe configs now updatedBeta Was this translation helpful? Give feedback.
All reactions