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

[9.x] Prevents booting of providers when running env:encrypt #44758

Merged
merged 1 commit into from
Oct 27, 2022

Conversation

joedixon
Copy link
Contributor

This PR resolves laravel/telescope#1262

When running env:encrypt with the --env option, the command is run as if in that environment and is booted using the associated environment file.

For example, php artisan env:encrypt --env=staging" runs the command using the environment variables from .env.staging`.

This can cause an issue if a service provider relies on a resource which is only accessible in that environment.

In the case of the issue above, it was Telescope attempting to register the Redis watcher for a cluster only accessible in the staging envrionment. Trying to run the command locally results in an exception being thrown.

To resolve the issue, I've prevented providers from booting when running the env:encrypt using the same approach as #44654

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.

Cannot use .env encrypt if telescope is enabled
2 participants