This is because it is not supposed to change anything in config/app.php
. Notice that uses the env
function:
'key' => env('APP_KEY', 'SomeRandomString'),
That means that it will look for your application key in the environment variables and default back to SomeRandomString
if it isn't found. The reason environment variables are used for this is that APP_KEY
shouldn't be hardcoded in the source. Ie. think of the example where you want to deploy multiple copies of your application, then all deployments would share the same APP_KEY
(which is bad practice).
.env
is just a convenient way of prepping your own development environment. In production you just set the APP_KEY
environment variable as part of your deployment.
Not something I would recommend, but alternatively you could replace the env
function call on 'key'
with a string containing the key that the artisan job showed you, like so:
'key' => 'OtherRandomString',
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community