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

[5.5] Add better error message for missing app key #19145

Merged

Conversation

thecrypticace
Copy link
Contributor

Running php artisan key:generate is done automatically by laravel new project_name but the experience is still subpar when cloning an existing repo.

This is especially an issue on teams when cloning existing repos. Even more so with new team members who may not know Laravel (or PHP) that well.

The current error message "The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths." is not helpful in determining what to do. It tells you that something is wrong but doesn't pinpoint what that thing is.

Because the most common occurrence of this exception is an empty or missing APP_KEY I thought it would be beneficial to check for this and present a more helpful exception.

@thecrypticace thecrypticace force-pushed the feature/better-app-key-missing-error branch from 05038a2 to 3a4fdd0 Compare May 11, 2017 02:07
@vlakoff
Copy link
Contributor

vlakoff commented May 11, 2017

You should move your added code above the startsWith test.

@thecrypticace
Copy link
Contributor Author

Well, this has the advantage of catching APP_KEY=base64: but I guess that's not very likely.

@taylorotwell taylorotwell merged commit 8f1a966 into laravel:master May 11, 2017
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

3 participants