Blog

Fix "No application encryption key has been specified." When Using Laravel

Laravel

If you have a Laravel app cloned from a Git repository, you mostly have to create your custom .env file. This .env file contains an encryption key, that is not set, when creating a duplicate of .env.example. If you open your application site, you will get the message

No application encryption key has been specified.

To fix this problem, all you have to do is to run this artisan command:

php artisan key:generate

This command will generate an encryption key for you and adds it to your .env file.