When running
php artisan key:generate
I can see the generated key in my shell, but the variable \'key\' in app.php remains empt
Have the same problem with L6 on Windows with xampp.
php artisan config:clearphp artisan key:generateHope it helps.
I was having the same issue. From my project directory I noticed I had the .env file, when I opened the project in atom (my code editor) I noticed that file appeared as .env.txt, I removed the .txt part and ran the command. It worked for me.
first type any 32 character like 'hyhyhGGyhyhyhyhy23hyhy23hyhy23hy' this and then re execute the command in terminal/cmd.
Step 1:
go to app ---> Config --> app.php
step 2:
'key' => '10101010101010101010101010101010', type any 32 digit or character in that place.
step 3:
go to terminal / cmd & type : "php artisan key:generate" press enter
step 4:
see the key has been changed :)
[ It is because in Laravel 4 By using "php artisan key:generate" we simply can replace the default key any time. But if it is an empty space it can not be able to hold the place. ]
Enjoy coding :) \m/
Had the same problem ...
- Opened app.php
- Remove the entry that says 'YourSecretKey!!!'
- Ran 'php artisan key:generate'
Showed me a key in the console, but nothing in app.php!
Solution is ... unlike Laravel 3, don't delete the default YourSecretKey!!! in app.php, just run the command and it will work.
Hope this helps.
Bagwaa
The key generator will only update the APP_KEY in the .env file.
'key' => env('APP_KEY', 'YourSecretKey'),
config/app.php this is reading the APP_KEY from your .env file. The second parameter is a fallback.
You should not remove the original key, just go to your project directory and run
php artisan key:generate
it will work if you don't touch the previous key.