From last week... https://laracasts.com/discuss/channels/testing/runtimeexception-no-application-encryption-key-has-been-specified-58
Does this help?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi there,
I'm running into an issue when I install a new 5.8 project and run phpunit.
I get the following error...
1) Tests\Feature\ExampleTest::testBasicTest
RuntimeException: No application encryption key has been specified.
However I can visit the app in the browser and it doesn't throw the same error which it would do if the encryption key didn't actually exist.
Also if I run the command in a project that uses 5.7 it works fine and even if I install a fresh version of 5.7 using
composer create-project laravel/laravel="5.7.*" myProject
everything works fine.
Has anyone got any ideas or encountered this situation and could provide some guidance?
From last week... https://laracasts.com/discuss/channels/testing/runtimeexception-no-application-encryption-key-has-been-specified-58
Does this help?
Please or to participate in this conversation.