I've installed a new Laravel application on my local machine and now I get the following error when running php artisan serve. This error is shown in my browser.
RuntimeException
No application encryption key has been specified.
Before using Laravel / Laravel's encrypter, you must set a key option in your config/app.php configuration file. Can can achieve this by running the following command in your command line interface:
1) Run this command in your command line interface:
php artisan key:generate
2) This command above will generate a key which will be automatically set in your .env file:
APP_KEY=base64:fpx9YL3dTKjQfUcKiGUeC+IwhrLu3ZYzIG/yAKkZ4Gw=
3) Once you have run the command the error message should disappear. The generated key will be used in the config/app.php file.
Simply run this command which will generate the app key:
php artisan key:generate