A common issue you might experience when working on a Laravel application is the exception:
RuntimeException No application encryption key has been specified.
You'll often run into this when you pull down an existing Laravel application, where you copy the .env.example
file to .env
but don't set a value for the APP_KEY
variable.
At the command line, issue the following Artisan command to generate a key:
php artisan key:generate
This will generate a random key for APP_KEY
, After completion of .env
edit please enter this command in your terminal for clear cache:php artisan config:cache
Also, If you are using the PHP's default web server (eg. php artisan serve
) you need to restart the server changing your .env
file values. now you will not get to see this error message.