Skip to content

[11.x] Respect custom path for cached views by the AboutCommand #55179

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

Conversation

alies-dev
Copy link

@alies-dev alies-dev commented Mar 26, 2025

It's possible to customize a path to cached view files via config and VIEW_COMPILED_PATH env var. But AboutCommand uses a hardcoded storagePath('framework/views') path. This PR aims to fix this issue.

BTW: it's the only occurrence of the framework/views and framework.views in code codebase (except some tests), so, no need to worry about other similar issues.

@alies-dev alies-dev changed the title [11.x] Respect custom view path by AboutCommand [11.x] Respect custom path for cached views by the AboutCommand Mar 26, 2025
@shaedrich
Copy link
Contributor

You might want to add a test to tests/Foundation/Console/AboutCommandTest.php

@@ -40,4 +41,16 @@ public function testItCanDisplayAboutCommandAsJson()
], $output['drivers']);
});
}

#[WithEnv('VIEW_COMPILED_PATH', __DIR__.'/../../View/templates')]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like making this test depend on templates from other tests, but also I'm not sure about adding custom fixtures here as compiled views is the main concern of this about console command. I would be glad if you could help with the testing approach here.

@taylorotwell taylorotwell merged commit e65c9b7 into laravel:11.x Mar 27, 2025
44 checks passed
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.

3 participants