I\'m new to Laravel and I\'m trying to use the Artisan command...
php artisan serve
It displays...
Laravel developme
simply run
php artisan key:generate
its worked for me
Open command prompt in the root folder of your project and run
php artisan key:generate
Then
php artisan config:cache
and Then
If you're getting the same error after having key-value, then just copy the APP_KEY value from .env file and paste it to config/app.php with 'key' => 'YOUR KEY',
and then again run
php artisan config:cache
Simply run this command:
php artisan key:generate
From Encryption - Laravel - The PHP Framework For Web Artisans:
"Before using Laravel's encrypter, you must set a key option in your config/app.php configuration file. You should use the
php artisan key:generate
command to generate this key"
I found that using this complex internet query in google.com:
"laravel add encrption key" (Yes, it worked even with the typo!)
Okay, I'll write another instruction, because didn't find the clear answer here. So if you faced such problems, follow this:
You should not just create empty .env file, but fill it with content of .env.example.
php artisan key:generate
Application key [base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=] set successfully.
APP_KEY=base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=
php artisan config:cache
That's it.
I found that most answers are incomplete here. In case anyone else is still looking for this: