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] Show error if key:generate artisan command fails #44927

Conversation

mbardelmeijer
Copy link
Contributor

This PR changes that if the artisan key:generate fails, an error message is shown.

This is most common when the .env file is missing an APP_KEY= empty placeholder. In this case, the preg_replace call will return the input as-is. If that happened, an error is shown instead of showing the incorrect Application key set successfully.

Fixes #44917

Copy link
Member

@driesvints driesvints left a comment

Choose a reason for hiding this comment

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

Good one 👍

@taylorotwell taylorotwell merged commit 5a36ee9 into laravel:9.x Nov 14, 2022
@LukeTowers
Copy link
Contributor

@driesvints @mbardelmeijer is there any interest in using something like the Laravel Config Writer provided by @wintercms (see https://github.com/wintercms/laravel-config-writer/blob/main/README.md#environment-files) to more reliably handle these issues rather than just failing?

@driesvints
Copy link
Member

@LukeTowers appreciate it but I don't think so no.

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.

APP_KEY not set when not in .env despite "Application key set" message
4 participants