Skip to content
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

[10.x] Configurable storage path via environment variable #48115

Merged

Conversation

sl0wik
Copy link
Contributor

@sl0wik sl0wik commented Aug 18, 2023

In the current implementation, the storage directory is statically set to storage. Given that this directory requires write permissions, it poses challenges in serverless environments and other scenarios where the filesystem might be read-only.

To enhance Laravel's adaptability to diverse hosting environments, this pull request introduces the capability to override the default storage directory using the STORAGE_PATH environment variable.

In the current implementation, the storage directory is statically set to `storage`. Given that this directory requires write permissions, it poses challenges in serverless environments and other scenarios where the filesystem might be read-only.

To enhance Laravel's adaptability to diverse hosting environments, this pull request introduces the capability to override the default storage directory using the `STORAGE_PATH` environment variable.
@taylorotwell
Copy link
Member

You can just call useStoragePath to customize the storage path.

@sl0wik
Copy link
Contributor Author

sl0wik commented Aug 18, 2023

That's what I do but then creating a package requires forking the entire project. I assume there must be some reason to keep this variable static. Thanks for checking anyway.

@taylorotwell taylorotwell reopened this Aug 18, 2023
@taylorotwell
Copy link
Member

taylorotwell commented Aug 18, 2023

Can you just check $_ENV directly instead of using Env::get?

@sl0wik
Copy link
Contributor Author

sl0wik commented Aug 18, 2023

I used Env::get because similar methods in the same file using it (like methods behind APP_SERVICES_CACHE and APP_PACKAGES_CACHE). I can change it to _ENV if you prefer.

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.

None yet

2 participants