I installed Laravel 5 through the composer, and after installation, the Application Key was generated automatically. I went to the .env file and I could see APP_KEY. However, I also noticed that there is another APP_KEY inside config/app.php app.php:
'key' => env('APP_KEY', 'SomeRandomString'), 'cipher' => 'AES-256-CBC',
My questions about newbies:
1) Why are there application keys in two different places?
2) When the application key was created, why didn’t it config/app.php ?
3) Do I need to manually insert the .env App key into the config/app.php or will this be optional if .env is there?
4) During future updates, do I need to continue to add the application key to the app.php file? So it will be reset during updates?
source share